Frohike
Posts: 23
Joined: Tue Apr 15, 2008 8:37 pm

Make credits link expand

I want the credits to expand when clicked. This is how I've done it so far.
in writeCredits I have added onclick on the a element, like this:

Code: Select all

		this.credits = hs.createElement('a', {
			href: "credits.php?userID="+this.custom.userID,
			onclick: "return hs.htmlExpand(this, { objectType: 'ajax' });",
			className: 'highslide-credits',
			innerHTML: hs.lang.creditsText,
			title: hs.lang.creditsTitle
		});
Why won't that work? I mean it doesn't expand, it just sends me straight to the credits.php file. I have tried adding the scr-thing to hs.htmlExpand, no luck. I guess it has something to do with the this keyword in the htmlExpand function, that it refers to the wrong object or something... Is it possible to fix it? I have tested with alert('hello'); instead of hs.htmlExpand and that works fine.

Edit: I just tried putting an expand link in the heading, and that produced the same result. So the problem lies somewhere else. Btw, I did the heading thing the standard way; by adding the <a onclick="hs.htmlExpand(this, {objectType: 'ajax'} )" in a <div class="highslide-heading">. Any new suggestions?

Return to “Highslide JS Usage”