sumeet007
Posts: 1
Joined: Wed Mar 04, 2015 5:30 pm

Highslide Auto Popup For One Time

Wed Mar 04, 2015 5:47 pm

Sir / Madam,

I have used Highslide script for auto popup on an index page. so that when user open the website the popup should get visible. But I want that it should visible only for one time to the user, and if user close the popup it should not visible again till browser session is active.

I have used the code below:

Below code has to paste before </head> tag

Code: Select all

<!---For HighSlide Auto Popup--->
		<script type="text/javascript" src="highslide/highslide-full.js"></script>
        <link rel="stylesheet" type="text/css" href="highslide/highslide.css">
		<script type='text/javascript'>//<![CDATA[
          // automatically open a link to a HTML page
          hs.graphicsDir = 'highslide/graphics/';
          hs.align = 'center';
          hs.outlineType = 'rounded-white';
          hs.dimmingOpacity = 0.75;

          hs.addEventListener(window, "load", function() {
          // click the element virtually:
          document.getElementById("autoload").onclick();
          });

          hs.registerOverlay({
	      html: '<div class="closebutton" onclick="return hs.close(this)" title="Close"></div>',
	      position: 'top right',
	      fade: 2 // fading the semi-transparent overlay looks bad in IE
          });
          //]]>
        </script>      
      <!---Ends Here--->

Below code has to paste after <body> tag

Code: Select all

<a id="autoload" class="highslide" href="popup.html" onclick="return hs.htmlExpand(this, {objectType: 'iframe', wrapperClassName: 'draggable-header'})" style="display:none;"></a>
Hope you should do some needfull...... :(

Return to “Highslide JS Usage”