- This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
hi,
i am setting up a jquery mobile site and using a jquery carousel on one of the pages.
but document.ready() function does not work at all.
i tried :
– $(document).bind(‘pageinit’)
– $(document).live(“pageinit”, function (event) {}
but nothing seems to work on the first load, unless i do a refresh. can anyone please suggest an alternative.
thanks.
Why not start off with an anonymous function?
function init() { ... Do stuff }
$(function() {
init();
});
Can’t tell why without seeing the actual code but I guess you did something like `$(document).ready( init() )` instead of `$(document).ready( init )` (first runs the function, second references to it). You can do it like John said, but if the only thing you do in that anonymous function you might as well just do
$(init);
or
$(function() {
// … Do stuff
});
@CrocoDillon, or EVEN:
(function init() {
// Do Stuff
})();
How long you think we can do this? lol… Anonymous functions are greatness!!!!
Haha… that doesn’t make sense! :P
@CrocoDillon, and another
;(function init() {
// ... Do some more stuff
})();
Alright, i think i am done now!
thanks guys, i tried this stuff, but i still could not get it working, the fix was to remove the ajax page calls.