I invoke it with jQuery like this:
- Code: Select all
$('a.highslide').click(function() {
return hs.expand(this);
});
And my HTML looks like this
- Code: Select all
<a href="big.jpg" class="highslide">
<img src="small.jpg" />
</a>
This fails and hs.expand(this); returns true which voids the highslider as you know.
So I deconstructed your code and noticed that a try/catch swallowed this error:
TypeError: a.getParams is not a function message=a.getParams is not a function
The code in question is this:
- Code: Select all
getParam : function (a, param) {
a.getParams = a.onclick;
var p = a.getParams();
a.getParams = null;
return (p && typeof p[param] != 'undefined') ? p[param] : hs[param];
},
Because of the way jQuery and event attachments seem to work, the A DOM element doesn't seem to have a this.onclick function when invoked like this which I think is a perfectly fine way of invoking highslide.
A (substandard) solution is to change all my HTML to be this instead:
- Code: Select all
<a href="big.jpg" onclick="return hs.expand(this)">
<img src="small.jpg" />
</a>
and this works.
Can we instead do something to way your getParam() function works so that it's not dependent on having onclick hardcoded into the DOM with HTML.[/quote]
