URL: http://vikjavev.no/highslide/forum/viewtopic.php?p=5190#5190

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);
});

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);
   };
});

Comments

Lukas

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>

Peter Bengtsson

I think there's a forum on the Highslide website. Ask there.

DUzun

Hi, Lukas!
Try putting that script in the body of the document.

Domas

//or just use it like this ;)

$(document).ready(function() {
$('a.highslide').each(function() {
this.onclick = function() {
return hs.expand(this);
};
});
});

ganesh suthar

i want to show pdf file in high slide getting pdf from database through ajax .

Your email will never ever be published.

Previous:
The Love Mattress January 6, 2008 Misc. links
Next:
input/textarea switcher with jQuery January 11, 2008 JavaScript
Related by category:
How to SSG a Vite SPA April 26, 2025 JavaScript
Switching from Next.js to Vite + wouter July 28, 2023 JavaScript
An ideal pattern to combine React Router with TanStack Query November 18, 2024 JavaScript
get in JavaScript is the same as property in Python February 13, 2025 JavaScript
Related by keyword:
How to fadeIn and fadeOut like jQuery but with Cash August 24, 2021 JavaScript
From jQuery to Cash June 18, 2019 Web development, JavaScript
Difference between $.data('foo') and $.attr('data-foo') in jQuery June 10, 2012 JavaScript
To $('#foo p') or to $('p', $('#foo')) February 24, 2009 JavaScript