dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: javascript

  1. #1
    Join Date
    May 2013
    Posts
    1

    javascript

    <div id="RotatingBannerDiv" style="visibility:hidden" runat="server">
    <div id="divImgTitle" style="height: 21px; background-color:#0068B5; width:194px ;" runat="server">

    </div>
    <div id="divimgs" style="width: 150px; height: 80px;" runat="server">
    <center> <a href="javascript:gotoshow()">
    <img src="../WebImages/hul.jpg" name="slide" border=0 style="filter:blendTrans(duration=1)"
    />
    </a>
    </center>
    </div>
    </div>
    <script type="text/javascript" lang="javascript">

    var whichlink = 0;
    var whichimage = 0;
    function slideit()
    {
    var blenddelay = (ie) ? document.images.slide.filters[0].duration * 500 : 0;

    if (!document.images)
    return;
    if (ie) {
    document.images.slide.filters[0].apply();
    document.images.slide.src = imageholder[whichimage].src;
    }
    if (ie) {
    document.images.slide.filters[0].play();
    whichlink = whichimage;
    whichimage = (whichimage < slideimages.length - 1 ? whichimage + 1 : 0);
    setTimeout("slideit()", slidespeed + blenddelay);

    }

    }

    if (document.getElementById('RotatingBannerDiv').style.visibility =="visible")
    {
    slideit();
    }



    </script>


    i want method to be call only if visibility of div is visible

    the above code gives me error as "Unable to get value of the property 'style': object is null or undefined"

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,689
    whai is 'ie' in your script? where is it defined?
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  3. #3
    Join Date
    Mar 2009
    Posts
    540
    [element reference].style only applies to style properties that are set inline. If it has a style quality that is set by a style sheet this will have no effect upon the style OBJECT of an element. For example, if your CSS decrees that the color of any DIV element should be "green," it will appear that way on the browser. But if you access the style element of the div elements it will not reflect this. On the other hand, if you set the color in the HTMl as in <div style="color: green"> or by using javascript to set it by [element].style.color = "green" then it will reflect that value.

    You need to set the initial value of its "visibility" by one of the two methods in order for your scheme to work.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles