It is currently Mon Jul 28, 2014 10:18 am Advanced search

how to define a highslide oncklick in JavaScript

Technical support, bug reports, feature requests and more.

how to define a highslide oncklick in JavaScript

Postby sumario » Wed Feb 15, 2012 3:48 pm

Hi,
I'm trying to say a button that is defined in JavaScript to open a html-site as a popup.
With a simple popup-window it works that way:

...handler:function(){uploadpopup=window.open ('http://....php','uploadwindow', 'width=800,height=600,left=100,top=200')....

..but it would look much better, if I could use a highslide-html-popup!
How do I have to change my popup-function?

Thanks for any advice!
User avatar
sumario
 
Posts: 3
Joined: Wed Feb 15, 2012 3:29 pm

Re: how to define a highslide oncklick in JavaScript

Postby torstein.honsi » Thu Feb 16, 2012 11:58 am

See hs.expand => "Opening the expander from JavaScript without using an anchor". The approach is similar for hs.htmlExpand.
Torstein Hønsi
CTO, Founder
Highsoft Solutions
User avatar
torstein.honsi
Site Admin
 
Posts: 9185
Joined: Thu Nov 09, 2006 1:22 pm
Location: Vik i Sogn, Norway

Re: how to define a highslide oncklick in JavaScript

Postby sumario » Fri Feb 17, 2012 12:42 pm

Thanks a lot,
the function works now, but it shows me a popup with no content (just the header with "close" and "move" and the footer with expand-function). What I┬┤m doing wrong?

That┬┤s what I defined in JavaScript:

Code: Select all
handler:function(){hs.htmlExpand(null, {src: 'http://....php'},{ contentId: 'import' });}


and that┬┤s what I defined inside the body of that .php-file:

Code: Select all
<div class="highslide-html-content" id="import" style="width: 500px">   
<div class="highslide-body">
...content...
</div>
</div>


When I┬┤m using the hs.expand-function with a image in the same folder it works.
Any advice?
User avatar
sumario
 
Posts: 3
Joined: Wed Feb 15, 2012 3:29 pm

Re: how to define a highslide oncklick in JavaScript

Postby RoadRash » Sat Feb 18, 2012 12:25 pm

Try this:
Code: Select all
handler:function(){hs.htmlExpand(null, { objectType: 'iframe', src: 'http://....php', width: 500 });}


You don't need all the highslide divs inside the .php file:
Code: Select all
<div class="highslide-html-content" id="import" style="width: 500px">   
<div class="highslide-body">
...content...
</div>
</div>

All you need in the .php file is the content (+ regular head and body section).
Hilde
Highslide Support Team

Overview of my Highslide sample pages: RoadRash.no
User avatar
RoadRash
 
Posts: 8207
Joined: Tue Jul 15, 2008 8:43 pm
Location: Fredrikstad, Norway

Re: how to define a highslide oncklick in JavaScript

Postby sumario » Sat Feb 18, 2012 2:40 pm

Thanks to both of you!
I┬┤m sure, next night I will sleep like a baby, now that I know how it works!!!

Best regards
Sebastian
User avatar
sumario
 
Posts: 3
Joined: Wed Feb 15, 2012 3:29 pm


Return to Highslide JS Usage

Who is online

Users browsing this forum: Bing [Bot] and 4 guests