Topic: My close button dosen't work in Win IE/FF

Hi guys!

As i said, i put in my gallery close button, because gallery opens in new window (target="_blank") Everything works fine in Mac firefox/safari, but when i check my gallery in Windows IE/FF i can't see my close button..? Whats wrong?

Here's my code (subfoleder index.php)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <?php
      /* Leave this block of php code intact if customizing this page */
      error_reporting(0);
      $preferences = file_get_contents('preferences.txt');
      $preferences = unserialize($preferences);
      $title = htmlspecialchars($preferences['htmlTitle'], ENT_QUOTES, 'UTF-8');
      $backgroundColor = substr($preferences['backgroundColor'], 2, strlen($preferences['backgroundColor']) - 2);
      print '<title>'.$title.'</title>';
    ?>
        <script type="text/javascript" src="swfobject.js"></script>
        <script type="text/javascript">
            var flashvars = {};
            flashvars.galleryURL = "gallery.xml?nocache=<?php echo rand(); ?>";
            var params = {};            
            params.allowfullscreen = true;
            params.allowscriptaccess = "always";
            params.bgcolor = "<?php echo $backgroundColor; ?>";
            swfobject.embedSWF("simpleviewer.swf", "flashContent", "100%", "100%", "9.0.124", false, flashvars, params);
        </script>
        
        <style type="text/css" media="screen">
            html, body    { height:100%; }
            body {            
                margin:0;
                padding:0;
                overflow:hidden;
                background-color: #000;
                color:#666;
                font-family:sans-serif;
                font-size:20px;        
            }
            a {    
                color:#ff0000;    
            }
            #close img {    
                position: absolute;
                padding-top: 350px;    
                border-style: none;
                
            }
        </style>
        
    </head>

This is quite urgent, so please help me, i you can. Thanks!

Slade

Re: My close button dosen't work in Win IE/FF

Please post a URL for the page that is having the issue, if it is not online please put up a test page.

Mike Richards
SimpleViewer Support Team.

Re: My close button dosen't work in Win IE/FF

Hi Mike!

Here's some demostration: http://www.chaoandeerojewel.com/gallery/berry_en/

I noticed, that somehow i did'nt paste whole code, so i try again:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <?php
      /* Leave this block of php code intact if customizing this page */
      error_reporting(0);
      $preferences = file_get_contents('preferences.txt');
      $preferences = unserialize($preferences);
      $title = htmlspecialchars($preferences['htmlTitle'], ENT_QUOTES, 'UTF-8');
      $backgroundColor = substr($preferences['backgroundColor'], 2, strlen($preferences['backgroundColor']) - 2);
      print '<title>'.$title.'</title>';
    ?>
        <script type="text/javascript" src="swfobject.js"></script>
        <script type="text/javascript">
            var flashvars = {};
            flashvars.galleryURL = "gallery.xml?nocache=<?php echo rand(); ?>";
            var params = {};            
            params.allowfullscreen = true;
            params.allowscriptaccess = "always";
            params.bgcolor = "<?php echo $backgroundColor; ?>";
            swfobject.embedSWF("simpleviewer.swf", "flashContent", "100%", "100%", "9.0.124", false, flashvars, params);
        </script>
        
        <style type="text/css" media="screen">
            html, body    { height:100%; }
            body {            
                margin:0;
                padding:0;
                overflow:hidden;
                background-color: #000;
                color:#666;
                font-family:sans-serif;
                font-size:20px;        
            }
            a {    
                color:#ff0000;    
            }
            #close img {    
                position: absolute;
                padding-top: 350px;    
                border-style: none;
                
            }
        </style>
        
    </head>
    

    
      <body onload="this.focus();">
    <div id="close">
    <a href="JavaScript:window.close()">
    <img src="../img/nothumb.gif" width="40" height="40" />
    </a>
    </div>
        <div id="flashContent">SimpleViewer requires JavaScript and the Flash Player. <a href="http://www.adobe.com/go/getflashplayer/">Get Flash.</a>.
        </div>
    
    

      </body>
</html>

Last edited by slade (2010-09-30 14:45:20)

Re: My close button dosen't work in Win IE/FF

Try adding:

params.wmode="transparent";

... and then setting the background color in the 'body' CSS rather than via params.bgcolor.

Steven Speirs
SimpleViewer Support Team.

Re: My close button dosen't work in Win IE/FF

Jesh!

That works! Thank's very much Steven! Damn, im happy!

-slade