I'm making and slide in function to that product page. So when you are close to the bottom a static block will come visible.
That static block should have a link to an article the link is different from product to product and is set in by a custom product attribute.
The problem is to get that custom attribute into my .js can you help?
What I've done so far
- Call in an custom.js in page.xml
- Make static block, and call it in at the bottom on view.phtml
custom_att name is article link
The js have only the "do somthing when you are close to bottom" function right now
jQuery(window).scroll(function() {
if(jQuery(window).scrollTop() + jQuery(window).height() > jQuery(document).height() - 100) {
alert("near bottom!");
}
})
Best Answer
You can place this JS code anywhere to product page :
Now you can use
javascript
variablearticle_link
anywhere on.js
file, in your case it'scustom.js