How can Access DIV Properties in Script while using Netscape 7.2

Discussion in 'Javascript' started by Nasir Wasim, Feb 16, 2005.

  1. Nasir Wasim

    Nasir Wasim Guest

    How can Access DIV Properties in Script while using Netscape 7.2.
    I want to use the div id with it's Visibility and left propertyin
    script but it's not working :-(


    Main File :
    -----------

    <div id="index" style="position:absolute; width:200px; height:115px;
    z-index:1; left:-400px; top: 286px visibility:false;">
    <object id="fl_index" type="application/x-shockwave-flash" .......>
    </Object>
    </div>

    I wanto use index.style.left=100 in script but it's not working
    Similarly i want to use index.style.visibility="Show" and it's not
    working.

    I have tried to use in many case like
    document.getElementById('index').style.visibility="visible"; but it is
    also not working in Netscape 7

    Waiting for affermative responce
    Nasir Wasim, Feb 16, 2005
    #1
    1. Advertising

  2. Re: How can Access DIV Properties in Script while using Netscape7.2

    try this:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

    <html>
    <head>
    <title>Untitled</title>
    <script language = "javascript" type = "text/javascript">

    var elemLeft = 100;
    var elemTop = 286;

    function moveObj(obj){

    var elemId = document.getElementById(obj);

    elemLeft = elemLeft - 5;
    elemId.style.left = elemLeft;

    }

    function disappear(obj){

    var elemId = document.getElementById(obj);

    if(elemId.style.visibility == "hidden"){

    elemId.style.visibility = "visible";

    } else{

    elemId.style.visibility = "hidden";

    }

    }

    </script>
    <style type = "text/css">

    #dIndex{

    position:absolute;
    width:200px;
    left: 100px;
    height:115px;
    z-index:1;
    top: 286px;
    visibility:hidden;
    background: gray

    }

    </style>

    </head>

    <body>
    <div id="dIndex">
    <p>Hello World</p>
    </div>
    <a href = "#" onClick = "moveObj('dIndex');return false;">Move</a> | <a
    href = "#" onClick = "disappear('dIndex');return false;">Disappear</a>

    </body>
    </html>


    Nasir Wasim wrote:

    >How can Access DIV Properties in Script while using Netscape 7.2.
    >I want to use the div id with it's Visibility and left propertyin
    >script but it's not working :-(
    >
    >
    >Main File :
    >-----------
    >
    ><div id="index" style="position:absolute; width:200px; height:115px;
    >z-index:1; left:-400px; top: 286px visibility:false;">
    > <object id="fl_index" type="application/x-shockwave-flash" .......>
    ></Object>
    ></div>
    >
    >I wanto use index.style.left=100 in script but it's not working
    >Similarly i want to use index.style.visibility="Show" and it's not
    >working.
    >
    >I have tried to use in many case like
    >document.getElementById('index').style.visibility="visible"; but it is
    >also not working in Netscape 7
    >
    >Waiting for affermative responce
    >
    >
    Cycloneous Echevarria, Feb 16, 2005
    #2
    1. Advertising

  3. Nasir Wasim

    Nasir Wasim Guest

    Thanks Cycloneous Echevarria
    One of my problem has been solved which is to display the Div tag by
    clicking through index button.
    But actually there are more then one index button in main page, each
    time the Top position of div tag would be changed and this is not
    working :-(

    I want to changed the Position of top (pixelTop) of div tag???

    Waiting for ur affermative responce.
    Nasir Wasim







    Cycloneous Echevarria <> wrote in message news:<>...
    > try this:
    >
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    >
    > <html>
    > <head>
    > <title>Untitled</title>
    > <script language = "javascript" type = "text/javascript">
    >
    > var elemLeft = 100;
    > var elemTop = 286;
    >
    > function moveObj(obj){
    >
    > var elemId = document.getElementById(obj);
    >
    > elemLeft = elemLeft - 5;
    > elemId.style.left = elemLeft;
    >
    > }
    >
    > function disappear(obj){
    >
    > var elemId = document.getElementById(obj);
    >
    > if(elemId.style.visibility == "hidden"){
    >
    > elemId.style.visibility = "visible";
    >
    > } else{
    >
    > elemId.style.visibility = "hidden";
    >
    > }
    >
    > }
    >
    > </script>
    > <style type = "text/css">
    >
    > #dIndex{
    >
    > position:absolute;
    > width:200px;
    > left: 100px;
    > height:115px;
    > z-index:1;
    > top: 286px;
    > visibility:hidden;
    > background: gray
    >
    > }
    >
    > </style>
    >
    > </head>
    >
    > <body>
    > <div id="dIndex">
    > <p>Hello World</p>
    > </div>
    > <a href = "#" onClick = "moveObj('dIndex');return false;">Move</a> | <a
    > href = "#" onClick = "disappear('dIndex');return false;">Disappear</a>
    >
    > </body>
    > </html>
    >
    >
    > Nasir Wasim wrote:
    >
    > >How can Access DIV Properties in Script while using Netscape 7.2.
    > >I want to use the div id with it's Visibility and left propertyin
    > >script but it's not working :-(
    > >
    > >
    > >Main File :
    > >-----------
    > >
    > ><div id="index" style="position:absolute; width:200px; height:115px;
    > >z-index:1; left:-400px; top: 286px visibility:false;">
    > > <object id="fl_index" type="application/x-shockwave-flash" .......>
    > ></Object>
    > ></div>
    > >
    > >I wanto use index.style.left=100 in script but it's not working
    > >Similarly i want to use index.style.visibility="Show" and it's not
    > >working.
    > >
    > >I have tried to use in many case like
    > >document.getElementById('index').style.visibility="visible"; but it is
    > >also not working in Netscape 7
    > >
    > >Waiting for affermative responce
    > >
    > >
    Nasir Wasim, Feb 18, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom
    Replies:
    0
    Views:
    486
  2. Mickey Segal
    Replies:
    1
    Views:
    644
    Mickey Segal
    May 21, 2004
  3. K Viltersten

    <div ... /> and <div ...></div>

    K Viltersten, Mar 30, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    726
  4. Dwayne Madsen

    Q: Div A inside Div B is larger than Div B

    Dwayne Madsen, Jun 1, 2005, in forum: Javascript
    Replies:
    1
    Views:
    177
    David Dorward
    Jun 1, 2005
  5. mscir
    Replies:
    3
    Views:
    297
    Martin Honnen
    Jun 26, 2005
Loading...

Share This Page