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 7 of 7
  1. #1
    New Coder
    Join Date
    Jun 2013
    Posts
    20
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Why would this code not allow a vistor to scroll

    I added this code as a banner on my site, but when it loads, it doesn't allow the visitor to scroll down the page. Any ideas of where I need to fix it?

    <!DOCTYPE html>
    <html><head>
    </head><body style="overflow: hidden;"><style type="text/css">
    #dayImage {
    width: 968px; height: 65px;
    border: none;
    }
    </style>

    <img src="undefined" id="dayImage" alt="image for DOW">

    <script type="text/javascript">
    var images = [
    "/Images/NextDayShippingBanner/NextDayShipping-Sunday.jpg",
    "/Images/NextDayShippingBanner/NextDayShipping-Monday.jpg",
    "/Images/NextDayShippingBanner/NextDayShipping-Tuesday.jpg",
    "/Images/NextDayShippingBanner/NextDayShipping-Wednesday.jpg",
    "/Images/NextDayShippingBanner/NextDayShipping-Thursday.jpg",
    "/Images/NextDayShippingBanner/NextDayShipping-Friday.jpg",
    "/Images/NextDayShippingBanner/NextDayShipping-Saturday.jpg",
    ];
    document.getElementById("dayImage").src =
    images[ (new Date()).getDay() ];
    </script>

    </body></html>

  • #2
    New Coder
    Join Date
    Aug 2013
    Posts
    50
    Thanks
    0
    Thanked 11 Times in 11 Posts
    Your <body> has an overflow: hidden style. Remove it and you can scroll.

  • Users who have thanked joesimmons for this post:

    tybrantt (08-11-2013)

  • #3
    New Coder
    Join Date
    Jun 2013
    Posts
    20
    Thanks
    15
    Thanked 0 Times in 0 Posts
    Thanks

  • #4
    New Coder
    Join Date
    Jun 2013
    Posts
    20
    Thanks
    15
    Thanked 0 Times in 0 Posts
    PS. If I wanted to add the same link to each image <href>, how would I add it?

  • #5
    New Coder
    Join Date
    Aug 2013
    Posts
    50
    Thanks
    0
    Thanked 11 Times in 11 Posts
    What do you mean?

  • #6
    New Coder
    Join Date
    Jun 2013
    Posts
    20
    Thanks
    15
    Thanked 0 Times in 0 Posts
    When this image appears, Id like it to have a link to my shipping policy. But Im sure how to add the h ref in front of the "/Images/NextDayShippingBanner/NextDayShipping-Saturday.jpg", ----since it doesnt have the img src in front of it

  • #7
    New Coder
    Join Date
    Aug 2013
    Posts
    50
    Thanks
    0
    Thanked 11 Times in 11 Posts
    Is the link always the same? If yes, then just wrap an anchor (link) tag around the image.

    Code:
    <a href="http://site.com/my_shipping_policy.html">
        <img src="undefined" id="dayImage" alt="image for DOW">
    </a>

  • Users who have thanked joesimmons for this post:

    tybrantt (08-11-2013)


  •  

    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
    •