seanooi 0 Newbie Poster

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.