Below is a static example of me triggering the scroll event.
It will alert the 'Dynamic Selector', the alert result in this case is:
#WordPanel #AZ-List div div div.ui-jqgrid-bdiv
(That's right its the same as the static select ive typed in the example below)
$("#WordPanel #AZ-List div div div.ui-jqgrid-bdiv").scroll(function() {
alert("#"+$(".left .active").val()+"Panel #"+$("#"+$(".left .active").val()+" div ul li.CmdActive").html()+" div div div.ui-jqgrid-bdiv");
});
I will now take the contents of the alert(); and use it as a dynamic selector, how ever it does not fire when i scroll the same scroll bars.
(Please note, the value of the selector below is exactly the same as the static one used in the example above.)
$("#"+$(".left .active").val()+"Panel #"+$("#"+$(".left .active").val()+" div ul li.CmdActive").html()+" div div div.ui-jqgrid-bdiv").scroll(function() {
alert("Working");
});
..A Bit more detail about the way it all works;
I have 2 divs side by side, There is a top navigation bar+buttons which controls if the left div, these control the content of the left div.
By default the first sub menu(populated by left's contents(controled by the top nav bar)) option is selected. This sub menu selection controls the content of the right div.(right content loads via ajax)
Im using .html(data); to add the contents into the right div. Within the contents is jquery and html code.
The above code issue is loaded at this point, when the right divs' contents is loaded.
Examples of things i need to match with one selector(dynamically)
#WordPanel #JK-List div div div.ui-jqgrid-bdiv
#WordPanel #AZ-List div div div.ui-jqgrid-bdiv
#AccountPanel #Password div div div.ui-jqgrid-bdiv
#AccountPanel #UserName div div div.ui-jqgrid-bdiv
At this stage, the issue was, it would select the first result by default and nothing else, in this case it would match:
#WordPanel #JK-List div div div.ui-jqgrid-bdiv
and not match
#WordPanel #AZ-List div div div.ui-jqgrid-bdiv
even once i have #AZ-List as the matching result(via alerting the selector in chrome console) The solution i will most likely be taking to this issue, will be having a hidden input that will hold the value of the sub menu's text(.html()), and going from there.