will someone modify this css code, only 2 adjustments required

Discussion in 'HTML & Website Design' started by cryoffalcon, Oct 10, 2010.

  1. #1
    Hi,
    i am using a popup in which i want a few adjustments as due to my weak knowledge i will not be able to do, so i would be happy if someone gives me 10 minutes of his life, as i don't think it will take more then that for an expert to do so
    i have one problem that this popup moves with screen is not fixed

    like the other popup on my same page which is a big play button that popup scrolls as you scroll so doesn't let you look at blog and it has a close button above game which is

    taking space, i thought if there is any way of getting rid of these

    two things,
    1st is to make the game scroll with the scroll
    2nd to bring down the close button under the game.
    well here is the link to the page where you can see it
    http://www.bloghuts.com/2010/09/laces-girl-dress-up.html
    here is the css
    #backgroundPopup{
    display:none;
    position:fixed;
    _position:absolute; /* hack for internet explorer 6*/
    height:100%;
    width:100%;
    top:0;
    left:0;
    background:#000000;
    border:1px solid #cecece;
    z-index:1;
    }
    #popupContact{
    display:none;
    position:fixed;
    top:0;
    left:0;
    _position:absolute; /* hack for internet explorer 6*/
    height:100%;
    width:100%;
    background:#FFFFFF;
    border:2px solid #cecece;
    z-index:2;
    }
    
    #popupContactClose{
    top:10px;
    left:10px;
    float: right;
        margin: 8px 15px 0px 0px;
    }
    #button{
    text-align:center;
    margin:5px;
    }
    Code (markup):
    this is the html i am using for it
    <div id="button">
    <input type="submit" value="Play" /></div>
    <div id="popupContact">
    <a id="popupContactClose">x</a>
    Here goes the game embed
    </div>
    <div id="backgroundPopup">
    </div>
    Code (markup):
    and this is the javascript for it
    <script type='text/javascript'>
    //<![CDATA[
    
    /***************************/
    popupforgames 
    /***************************/
    
    //SETTING UP OUR POPUP
    //0 means disabled; 1 means enabled;
    var popupStatus = 0;
    
    //loading popup with jQuery magic!
    function loadPopup(){
    //loads popup only if it is disabled
    if(popupStatus==0){
    $("#backgroundPopup").css({
     "opacity": "0.7"
    });
    $("#backgroundPopup").fadeIn("slow");
    $("#popupContact").fadeIn("slow");
    popupStatus = 1;
    }
    }
    
    //disabling popup with jQuery magic!
    function disablePopup(){
    //disables popup only if it is enabled
    if(popupStatus==1){
    $("#backgroundPopup").fadeOut("slow");
    $("#popupContact").fadeOut("slow");
    popupStatus = 0;
    }
    }
    
    //centering popup
    function centerPopup(){
    //request data for centering
    var windowWidth = document.documentElement.clientWidth;
    var windowHeight = document.documentElement.clientHeight;
    var popupHeight = $("#popupContact").height();
    var popupWidth = $("#popupContact").width();
    //centering
    $("#popupContact").css({
    "position": "absolute",
    "top": windowHeight/2-popupHeight/2,
    "left": windowWidth/2-popupWidth/2
    });
    //only need force for IE6
    
    $("#backgroundPopup").css({
    "height": windowHeight
    });
    
    }
    
    
    //CONTROLLING EVENTS IN jQuery
    $(document).ready(function(){
    
    //LOADING POPUP
    //Click the button event!
    $("#button").click(function(){
    //centering with css
    centerPopup();
    //load popup
    loadPopup();
    });
    
    //CLOSING POPUP
    //Click the x event!
    $("#popupContactClose").click(function(){
    disablePopup();
    });
    //Click out event!
    $("#backgroundPopup").click(function(){
    disablePopup();
    });
    //Press Escape event!
    $(document).keypress(function(e){
    if(e.keyCode==27 && popupStatus==1){
     disablePopup();
    }
    });
    
    });
    
    //]]>
    </script>
    Code (markup):
    thank you in advance
     
    cryoffalcon, Oct 10, 2010 IP
  2. cryoffalcon

    cryoffalcon Peon

    Messages:
    102
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well no need to help i solved the problem on my own, thank you everyone for reading and giving me time.
    take care.
     
    cryoffalcon, Oct 11, 2010 IP