Announcement

Collapse
No announcement yet.

clever popup code, if anyone wants it.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    clever popup code, if anyone wants it.

    We were annoyed at actinics handling of extended popups, so i knocked this up. Various code cobbled together from the intearweb. It makes a popup window auto resize, to the exact dims of an image passed into it. The code ignores the numbers passed to it by actinic. Clicking the image in the popup closes the window.
    nice and clean.

    Warning: produced in a factory where nuts are handled.

    HTML Code:
    <HTML>
    <HEAD>
    <Actinic:WINDOW WIDTH="NETQUOTEVAR:INFOIMAGEWIDTH" HEIGHT="NETQUOTEVAR:INFOIMAGEHEIGHT"/>
    <TITLE>NETQUOTEVAR:PAGETITLE</TITLE>
       <Actinic:BASEHREF VALUE="NETQUOTEVAR:BASEHREF"/>
     <script language='javascript'>
       var arrTemp=self.location.href.split("?");
       var picUrl = (arrTemp.length>0)?arrTemp[1]:"";
       var NS = (navigator.appName=="Netscape")?true:false;
    
         function FitPic() {
           iWidth = (NS)?window.innerWidth:document.body.clientWidth;
           iHeight = (NS)?window.innerHeight:document.body.clientHeight;
           iWidth = document.images[0].width - iWidth;
           iHeight = document.images[0].height - iHeight;
           window.resizeBy(iWidth, iHeight);
           self.focus();
         };
     </script>
    </HEAD>
    <BODY bgcolor="#000000" onload='FitPic();' topmargin="0"  
    marginheight="0" leftmargin="0" marginwidth="0">
     <script language='javascript'>
     document.write( "<A HREF=\"javascript:window.close();\"><IMG SRC=\"NETQUOTEVAR:INFOIMAGE\" WIDTH=NETQUOTEVAR:INFOIMAGEWIDTH HEIGHT=NETQUOTEVAR:INFOIMAGEHEIGHT border=\"0\"></a>" );
     </script>
    
    </BODY>
    </HTML>
    after you save this file, set it as the default popup code in your Design > Options > default extended info template.

    /me tips hat

    #2
    Nice one Gabriel.

    Lee did one back in v6 which should still work in v7 also http://community.actinic.com/showthread.php?t=8203


    Bikster
    SellerDeck Designs and Responsive Themes

    Comment


      #3
      Awesome. I'll adapt this for v8 and add it to the Advanced User Guide

      Comment


        #4
        Here's the version 8 code:

        Code:
        <html>
        <head>
        <Actinic:WINDOW width="<Actinic:Variable Name="ExtendedInfoImageWidth"/>" height="<Actinic:Variable Name="ExtendedInfoImageHeight"/>"/>
           <title><actinic:variable name="PageTitle" /></title>
           <actinic:variable name="BaseHref" />
            <script language='javascript'>
        	  var arrTemp=self.location.href.split("?");
        	  var picUrl = (arrTemp.length>0)?arrTemp[1]:""; 
        	  var NS = (navigator.appName=="Netscape")?true:false; 
        	  
        	  function FitPic()	   {
        	   iWidth = (NS)?window.innerWidth:document.body.clientWidth; 
        	   iHeight = (NS)?window.innerHeight:document.body.clientHeight; 
        	   iWidth = document.images[0].width - iWidth; 
        	   iHeight = document.images[0].height - iHeight; 
        	   window.resizeBy(iWidth, iHeight); self.focus(); }; 
        	</script>
        </head>
        <body bgcolor="#000000" onload='FitPic();' topmargin="0" marginheight="0" leftmargin="0" marginwidth="0">
          <script language='javascript'>
            document.write( "<a href=\"javascript:window.close();\"><img src=\"<Actinic:Variable Name="ExtendedInfoImage"/>\" width=\"<Actinic:Variable Name="ExtendedInfoImageWidth"/>\" height=\"<Actinic:Variable Name="ExtendedInfoImageHeight"/>\" border=\"0\"></a>" );
          </script>
        </body>
        </html>

        Comment

        Working...
        X