Mobile version of this page
Previous:
The Love Mattress
Next:
input/textarea switcher with jQuery
Lesson learnt with creating DOM element with jQuery
Why Django and Grok matters
JetBlue a good and bad website
AJAX accelerated web widgets
The Love Mattress
Next:
input/textarea switcher with jQuery
Related blogs
RememberYourFriends.com running jQueryLesson learnt with creating DOM element with jQuery
Why Django and Grok matters
JetBlue a good and bad website
AJAX accelerated web widgets
Related by category
jQuery and Highslide JS
http://vikjavev.no/highslide/forum/viewtopic.php?p=5190#51908th of January 2008
If you use the wonderful Javascript library jQuery and the wonderful (standalone) Javascript plugin Highslide JS of recent version you should be aware of something.
As of recent versions of Highlide the way the Expander function works is that it looks at an element's onclick attribute and not it's attached events which means that if a DOM element has the event but not the attribute you get a Javascript error. In older versions of Highslide you were able to do this:
$('a.highslide').click(function() {
return hs.expand(this, options);
});
return hs.expand(this, options);
});
But that's no longer working since the attribute isn't set. Here's the new way of doing it:
$('a.highslide').each(function() {
this.onclick = function() {
return hs.expand(this, options);
};
});
this.onclick = function() {
return hs.expand(this, options);
};
});







Save this page in del.icio.us
Hi Peter!
I would like to call up Highslide for every markup putting this script in the header...but it doesn't work! Could you maybe help? Thank you!! ~Lukas
<script type="text/javascript">
$('a').each(function(){
this.onclick = function() {
return hs.htmlExpand(this, { objectType: 'iframe' } );
});
</script>