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 4 of 4
  1. #1
    New Coder
    Join Date
    Sep 2012
    Posts
    47
    Thanks
    13
    Thanked 0 Times in 0 Posts

    an easy one... I think. (Div Tag - Class/ID)

    This is in the head:
    Code:
    	<script type="text/javascript">
    	window.onload = function() {
    	img = document.getElementById('refreshradar');
    	img.src += "?";
    	setInterval("img.src=img.src.replace(/\\?[0-9]*/, '?'+Math.floor(Math.random()*9999999+1));", 150000);}</script>
    This is in the body:
    Code:
    <div id="radar" style="position:absolute;left:988px;top:780px;">
    <img src="http://i.cdn.turner.com/cnn/.element/img/3.0/weather/maps/nxrd_txe.gif" id="refreshradar" width="348" height="258"  border="1" /></div>
    As far as I can tell, this works just fine. It auto updates the above radar every so often. (I hope)

    Now, how would I make the below code also auto update every 5-10 minutes?:
    Code:
    <div id="weatherslider" style="position:absolute;left:640px;top:780px;">
    	<span class="ws-location">Houston, US</span></div>	
        
        <script type="text/javascript">
    			$(document).ready(function(){
    				$('#weatherslider').weatherSlider({
    					WWOAPIKey: '20989fj928hj98281h8918w9whe9'});});</script>
    Can I do it with like another Div ID tag? It doesn't seem to work right if I just add another id="refreshradar" after the </span>
    Last edited by themoon; 05-20-2013 at 08:02 PM.

  • #2
    Senior Coder jerry62704's Avatar
    Join Date
    Oct 2007
    Location
    Springfield, IL
    Posts
    1,100
    Thanks
    13
    Thanked 87 Times in 87 Posts
    Hi moon.

    jQuery questions are probably better in the javascript forums. But you might get some comments about the "absolute"s you have. Do you really need them?
    .
    .
    ...and gladly would he learn and gladly teach

    Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls

  • #3
    New Coder
    Join Date
    Sep 2012
    Posts
    47
    Thanks
    13
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jerry62704 View Post
    Hi moon.

    jQuery questions are probably better in the javascript forums. But you might get some comments about the "absolute"s you have. Do you really need them?
    It's for a digital signage display. So no user interaction and only one "web page". This isn't being viewed by multiple browsers.
    So it was easy to just place my content this way.

    I thought it being a div tag related it would go in this thread. If it should be moved to javascript though how do I do that?

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,798
    Thanks
    6
    Thanked 1,023 Times in 996 Posts
    You don’t, I do.


  •  

    Posting Permissions

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