simple jquery problem - creating and calling functions

Joined
12 Feb 2006
Posts
17,675
Location
Surrey
this is seriously simple i know i just can't seem to do it, perhaps it's because it's late i don't know but i'm hoping when i get up someone can give me the nice and easy solution so i can get on with my work.

i want to create a function and then be able to call it from a timer.

i tried

PHP:
change1(function(){

// do cool jquery amazing stuff

})
didn't work :(

just in case it makes a difference what i'm trying to do is have 3 functions (change1,change2,change3) running one at a time. change1 checks if there is an element with id1, if yes do effect, wait a bit of time, then run change2, if id1 doesn't exist just do change2 straight away. change2 does same, checks, moves onto change3, which restarts again.
 
ah silly me that got it working, well almost.

the above is basically exaclty what i have just with the jquery stuff in it. the trouble is i get the following error: "missing ) after argument list" it says this for the line function change1() {

any clues why?
 
sorry, i missed the closing bracket round the $(document).ready( function()


should be

Code:
$(document).ready( 
    function()
    {
        setTimeout(change1(), //timevalue in ms));
    }
)


i tried this but now the fade effect doesn't work, only when in the document.ready(, however the script still does the result if that makes sense. e.g. i want to fade between text, rather then fading it just changes to text.
 
i tried this but now the fade effect doesn't work, only when in the document.ready(, however the script still does the result if that makes sense. e.g. i want to fade between text, rather then fading it just changes to text.

this is my problem ladforce, not the bracket problem you have said about.

i think i have realised the problem any way so thank you all for the help :)
 
Back
Top Bottom