I'm trying to do things with jQuery on my pages and it works for any page that is not rewritten with the URL rewrite stuff... but anything that turns out like this:
I registered my script the same way and it shows up with the full path in my page (you can see it when you view source on the page), but the script just doesn't work. You go to a page that doesn't have the URL rewritten and it works just fine.
var top = j$('#smc_cart').offset().top - 15 //parseFloat(j$('#smc_cart').css('margin-top').replace(/auto/, 0));
j$(window).scroll(function (event){ // what the y position of the scroll is var y = j$(this).scrollTop(); // whether that's below the form if (y >= top) { // if so, ad the fixed class j$('#smc_cart').addClass('fixed'); } else { // otherwise remove it j$('#smc_cart').removeClass('fixed'); } }); });
With the first bits of code I'm trying to load something from another page into a <div>... update only that <div> on a click (eventually)... doesn't work.
With the second part I have the mini shopping cart follow you as you scroll down so you can always see what's in your cart... that works just fine.
I was so worried about the path to the scripts that I didn't realilze that I needed absolute paths to the files that I was trying to access with the script.
Problem solved.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.