How to add blinking effect in .php

Discussion in 'Programming/Scripts' started by dinesh.4126, Aug 18, 2009.

  1. dinesh.4126

    dinesh.4126 New Member

    Hi,
    I am having code for google map weather information display.Using overlay text on image to pass text on google map.How can I add blinking effect in image .php code.
    Can some body guide me ??
     
  2. dinesh.4126

    dinesh.4126 New Member

    Below are the part of PHP code
    HTML:
     if($fish_info)
                            { ?>
                                    var latlng = new GLatLng(northEast.lat()-latSpan * 0.3,
                                    northEast.lng()-lngSpan * 0.1);
                                    info = "<?php echo $fish_info; ?>" ;
                                    file = "<?php echo 'img/fish.png'; ?>" ;
                                    map.addOverlay(createMarker(latlng,file,info)); 
                             <?php
                            }?>   
    In the attachment fish image display on Google map.But I want to give blinking effect on Fish image How can I do????
    Suggest something Upon this.......
     

    Attached Files:

  3. edge

    edge HowtoForge Supporter

    Why not replace the fish.png' with a blinking "animated" .gif, and use that?
     
  4. dinesh.4126

    dinesh.4126 New Member

    But we can also do using Java Script,HTML??
    How can I replace the Fish.png with Blinking Animated .gif.Will it work with PHP code if I Replace with Animated Image??
    If I am saving downloaded animated .gif image and using that image in php code its not blinking....
     
    Last edited: Aug 26, 2009
  5. dinesh.4126

    dinesh.4126 New Member

    Hi,
    Google search I found JAVA script for Blinking used that script to introduce the blinking effect and get some success in doing but its Blinking Outside Google map separate fish image.Not on Google map.Thing become clear in attachment.
    Code:
    <script type="text/javascript">
     var blinkImg = function (imgname, s) {
         clearTimeout(blinkImg['blinking' + imgname]);
            var obj = document.images[imgname];
              if (arguments[1] === 'blink') {
             obj.style.visibility = !(blinkImg[s + imgname] = !blinkImg[s + imgname])? '' : 'hidden';
         blinkImg['blinking' + imgname] = setTimeout(function(){blinkImg(imgname, s);}, 350);
                                                                    }
             else {
                blinkImg['blink' + imgname] = false;
        obj.style.visibility = '';
                                                                                                                    }
                                                                                                                    };
     </script>
                                                                                                                                                                                                                          <body>
    
     <img name="blinker1" src="img/imagename.gif"><br>
     <input type="button" onclick="blinkImg('blinker1', 'blink');" value="Blink">
     <input type="button" onclick="blinkImg('blinker1', 'stop');" value="Stop">
     </body>
    Below are PHP code
    PHP:
      if($fish_info)
                            { ?>
                                    var latlng = new GLatLng(northEast.lat()-latSpan * 0.3,
                                    northEast.lng()-lngSpan * 0.1);
                                    info = "<?php echo $fish_info?>" ;
                                    file = "<?php echo 'img/imagename.gif'?>" ;
                                    map.addOverlay(createMarker(latlng,file,info)); 
                            
    and in above code imagename.gif is fish image .And want this image will be blinking on google map.Right now its which is not happening on google map.Can somebody assist what change I supposed to do make it blinking on google map.Kindly help me out from this.Something missing from my side please let me know..
     

    Attached Files:

    Last edited: Aug 26, 2009
  6. dinesh.4126

    dinesh.4126 New Member

    Hi,
    See in PHP code var latlng = new GLatLng(northEast.lat()-latSpan * 0.3,northEast.lng()-lngSpan * 0.1); is location of Fish Image on google map and file = "<?php echo 'img/fish.png'; ?>" ; is the Image path.And problem is that How can I call blinking function inside map.addOverlay(createMarker(latlng,file,info)); so that Image will start blinking on Map.Suggest me upon this????:confused:
     

Share This Page