Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to set focus on image in popup.

    Hi Friends,

    I am setting focus in popup window .in IE it is working properly but in mozilla the same code is not able to set focus on image.please tell me the solution if u knows.

    My code is follows...myJsp.jsp==========

    <div class="smallDottedBlueLink" >
    <a title="" class="smallDottedBlueLinkAnchor" href="#" onkeypress="setFocusOnKeyPressPopUp(event);" onclick="setFocusOnClickPopUp();"
    id="Hotels_TnC_popUp">View Terms and Conditions</a>
    //focusNew1 is the id of the image in popup page.
    function setFocusOnKeyPressPopUp(event){
    setTimeout('document.getElementById("focusNew1").focus();',1000);
    // setTimeout('dummy();',3000);
    }

    function setFocusOnClickPopUp() {
    setTimeout('document.getElementById("focusNew1").focus();',1000);
    } </div>


    =============html page===============popup code ====
    <div>
    <div class="popup-top-corner-left-img"></div>
    <div class="popup-top-image"></div>
    <div class="popup-top-corner-right-img"></div>
    </div>
    <div>
    <div class="popup-left-image"></div>
    <div class="popup-div1">
    <div>
    <div class="XX-Large-Dark-Gold-popUpText">ffffff</div>
    //id="focusNew1" for this id i need to set focus <div class="sprite-btn-close" id="focusNew1" onkeydown="javascript:return keyCheck(event)" onkeypress="javascript:closePopUpLayer1(event)" onclick="javascript:closePopUpLayer(),document.getElementById('Hotels_TnC_popUp').focus();" ></div> </div>
    <div class="popup-dark-gray-text">fff</div>
    </div>
    <div class="popup-right-image"></div>
    </div>
    <div class="popup-bottom">
    <div class="popup-bottom-corner-left-img"></div>
    <div class="popup-bottom-image"></div>
    <div class="popup-bottom-corner-right-img"></div>
    </div>

    please let me know in case any mistake i made ...its very urgent.
    ThanksIn advance.

  • #2
    Regular Coder
    Join Date
    Dec 2007
    Posts
    107
    Thanks
    0
    Thanked 3 Times in 3 Posts
    try using self.focus() for the image.

    let us know if that works.
    Programming & Webmaster Forum - AdSense Revenue Sharing forum

  • #3
    New to the CF scene
    Join Date
    Oct 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    where i need to use this line


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •