jQuery within the plugin
-
Hey Mordauk!
Thanks for the great plugin! It’s very useful. But I have a problem and after hours of trying I’m not able to find a solution for it.
I want to implement a link in the restricted message which scrolls the whole page to the top (there’s the login form)
Therefore I have written a script.js file (in my template folder) with the following content:jQuery(“#loginalert”).slideDown(“fast”);
jQuery(‘#loginalert’).click(function() {
jQuery(‘html,body’).animate({scrollTop: 0}, 1000);
});If I put the A HREF Tag (
<a href="#" id="loginalert">Scroll up to login</a>) into a wordpress post, everything works fine as it should.
But if I try to use it in the plugin it doesn’t work. Even if i put the A HREF Tag in the shortcodes.php directly nothing is happening.
(`return ‘<span style=”color: red;”>’ . str_replace(‘{userlevel}’, $userlevel, $rc_options[‘shortcode_message’]) .'</span><a href=”#” id=”loginalert”>Scroll up to login</a>’;
}` )Maybe you can give me a hint. I would appreciate it a lot cause I’m not a good coder at all :/
The topic ‘jQuery within the plugin’ is closed to new replies.