javascript - Adding selectmenu on select that's calling functions -
i have script loads html content div , applies jquery tabs @ same time. however, want jquery selectmenu on select @ same time.
i'm having trouble figuring out how nest these.
i'll continuing looking @ api docs, , tutorials, stackoverflow etc.
but, in meantime, thought expedite process.
this script is:
$(function() { var work = $( "#display" ); $( "#selector" ).change(function( event ) { work.load($(this).val(),function(){ $("#textdisplay").tabs(); }); }); });
this script works want to, doesn't styled theme because it's not selectmenu
i want select use selectmenu:
$(function() { $( "#selector" ).selectmenu(); });
attempt 1:
$(function() { var work = $( "#display" ); $( "#selector" ).selectmenu( $( "#selector" ).change(function( event, ui ) { work.load($(this).val(),function(){ $("#textdisplay").tabs(); ); }); }); });
attempt 2:
$(function() { var work = $( "#display" ); $( "#selector" ).selectmenu({ change: function( event ) { work.load($(this).val(),function(){ $("#textdisplay").tabs(); }); }); }); });
attempt 3:
$(function() { var work = $( "#display" ); $( "#selector" ).selectmenu({ change: function( event, ui ) { work.load($(this).val(),function(){ $("#textdisplay").tabs(); }); }); }); });
attempt 4:
this attempt loads selectmenu theme, kills functionality
$(function() { $( "#selector" ).selectmenu(); }); $(function() { var work = $( "#display" ); $( "#selector" ).change(function( event ) { work.load($(this).val(),function(){ $("#textdisplay").tabs(); }); }); });
attempt 5:
$(function() { var work = $( "#display" ); $( "#selector" ).selectmenu ({ selectmenuchange: function( event, ui ) { work.load($(this).val(),function(){ $("#textdisplay").tabs(); }); } }); });
so, went jquery documentation , found correct syntax make work. learned little more how use console tab in developer tools view track down syntax errors.
$(function() { var work = $( "#display" ); $( "#selector" ).selectmenu ({ change: function( event, data ){ work.load($(this).val(),function(){ $("#textdisplay").tabs(); }); } }); });
Comments
Post a Comment