<select id="selectchoice> needs a closing " for the id.
The .change() function isn't dependent upon selectedIndex or value of the selected option.
__________________ ^_^
If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
$(document).ready(function(){
$("#select_box").change(function(){
var selectedOption = $('#select_box :selected').val();
$containerDiv = $('#div_where_content_loads_in');
switch (selectedOption)
{
case "Option1":$containerDiv.load( "page.html#div1" ); break;
case "Option2":$containerDiv.load( "page.html#div2" ); break;
case "Option3":$containerDiv.load( "page.html#div3" ); break;
case "Option4":$containerDiv.load( "page.html#div4" ); break;
}
});
});
Problem:
When this code tries to load in a div containing a ui-slider element the graphics dont show up.
The slider is there but its hidden becuse if I place one slider in the page from pageload/start (visible) and one slider in the div that gets loaded (invisible), then give them same ID so the slide handle-bars move at the same time (when only moving one), in the exaxtly moment of moving the visible slider the invisible slider shows up.
Its feels like it dont have any CSS rules when loaded in and then it gets the same rules at the other slider when its have to work.
Have anybody here experienced anything similar before?
Most likely, it's because the content is not loaded at page load, so there is nothing to initialize. Have you tried placing the init within the content that is being loaded?
__________________ ^_^
If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
Most likely, it's because the content is not loaded at page load, so there is nothing to initialize. Have you tried placing the init within the content that is being loaded?
I think your speculations are correct. I later tested to load a entire page (with slider) into the div and not just the div with the slider and then the slider is visible, the loaded page initialize the slider i guess (brings that page rules).
What do you mean by placering the init? (Sorry my first week at jQuery)
Usually, in jQuery, things like sliders, scrollers, etc., have to be "initialized" after content has loaded. For example, if you are using nanoScroller (Mac style scroll bar, cross browser), if the div that is using nanoScroller doesn't have any content, it doesn't have height, so when you init by using $('#divName').nanoScroller();, it doesn't work because nanoScroller doesn't "see" anything there.
__________________ ^_^
If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
Usually, in jQuery, things like sliders, scrollers, etc., have to be "initialized" after content has loaded. For example, if you are using nanoScroller (Mac style scroll bar, cross browser), if the div that is using nanoScroller doesn't have any content, it doesn't have height, so when you init by using $('#divName').nanoScroller();, it doesn't work because nanoScroller doesn't "see" anything there.
Ok I think I understand, I google it before also when I saw your post and read some about it at the jQuery site, so basically the slider dont get initialized. Do I have to ad some code or does this make it impossible to have this type of content in divs that get its content loaded in?
Basically, place the src to jQuery in each HTML file that is being dynamically loaded, and initialize the slider in each page in the $(document).ready() function. That way it initializes on each page load.
__________________ ^_^
If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
Basically, place the src to jQuery in each HTML file that is being dynamically loaded, and initialize the slider in each page in the $(document).ready() function. That way it initializes on each page load.
Ok, I linked the jQuery src in all files that being loaded and aded this to the script: