954,597 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

jQuery .scrollTo to call PHP function

Hi guys, I have no experience with jQuery or php at all besides the ones I see in Wordpress and the functions I included in my themes so forgive me if I sound stupid.

I'm trying to include the .scrollTo function in my theme, and was wondering if it's possible to call a php function in jQuery.

$(document).ready(function()
{
// scroll to top
$('a.topOfPage').click(function(){
$.scrollTo( 0, 500);
return false;
});
});


in .scrollTo() I tried

.scrollTo( '#post-5', 500);

and it worked, but when i tried replacing #post-5 with

#post-<?php the_ID(); ?>

it just didn't work. Is there a way to make this happen?

seanooi
Newbie Poster
19 posts since May 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You