rolo Posted March 3, 2011 Share Posted March 3, 2011 so on an smf forum i want to add a scrollTo javascript code to an anchor tag and since i don't know php can't figure it out since it breaks the syntax here's the anchor tag i wish to add with the html/javascript: <a href="#top" onclick="$.scrollTo( '#top', 900 ); return false;" title="Back to Top">Back to Top</a> to this div: echo ' </div> <div id="copyright"> <span class="backtop"> <A HREF GOES HERE> </A> </span> </div> </div>'; i will greatly appreciate your help on this, thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/229497-need-help-on-this/ Share on other sites More sharing options...
Muddy_Funster Posted March 3, 2011 Share Posted March 3, 2011 that's not a lot to work with... try this: echo ' </div> <div id="copyright"> <span class="backtop">'."<a href=\"#top\" onclick=\"$.scrollTo( '#top', 900 ); return false;\" title=\"Back to Top\">Back to Top</a>".' </span> </div> </div>'; Quote Link to comment https://forums.phpfreaks.com/topic/229497-need-help-on-this/#findComment-1182417 Share on other sites More sharing options...
rolo Posted March 4, 2011 Author Share Posted March 4, 2011 YES! that worked perfectly. never in my life i would've figured that out :-\ i need to learn php ASAP...pronto! many many thanks man! Quote Link to comment https://forums.phpfreaks.com/topic/229497-need-help-on-this/#findComment-1182665 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.