Warning: file_get_contents(http://www.wordpresstemplates.com/form_work2/?url=http://www.wbruno.com.br/blog&installed=1253799329) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/httpd/vhosts/wbruno.com.br/httpdocs/blog/wp-content/themes/hydrophile/start_template.php(8) : eval()'d code on line 6

só ativar links ao carregar imagens

No Comments »

hein?! pseudo-código ? não entendi oque você tentou fazer, ou se isso ai em cima existe.. o que eu pensei, foi o seguinte: Desativar Link antes do carregamento

  1.  
  2. <script type="text/javascript">// <![CDATA[
  3. window.onload = function()
  4. {
  5.         var as = document.getElementsByTagName('a');
  6.         for( var i=0; i<as.length; i++ )
  7.         {
  8.                 as[i].onclick = function()
  9.                 {
  10.                         return true;
  11.                 }
  12.         }
  13. }
  14. // ]]></script> <!–  –>
  15. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  16.         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  17. <html xmlns="http://www.w3.org/1999/xhtml">
  18. <head>
  19.         <title>Desativar Link antes do carregamento</title>
  20.         <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  21.  
  22. <script type="text/javascript">
  23. window.onload = function()
  24. {
  25.         var as = document.getElementsByTagName(‘a’);
  26.         for( var i=0; i<as.length; i++ )
  27.         {
  28.                 as[i].onclick = function()
  29.                 {
  30.                         return true;
  31.                 }
  32.         }
  33. }
  34. </script>
  35. <style type="text/css">
  36.  
  37. </style>
  38. </head>
  39. <body>
  40.  
  41.         <a href="teste.html"><img src="http://diogoparker.files.wordpress.com/2008/11/13-daylight_planet_wallpaper_by_janedoe873.jpg" alt="" /></a>
  42.         <a href="teste.html"><img src="http://wallpaperslindos.files.wordpress.com/2008/12/outono_wallpaper_by_black_energy.jpg" alt="" /></a>
  43.         <a href="teste.html"><img src="http://fc05.deviantart.com/fs20/f/2007/270/3/4/Balance_Wallpaper_by_nxxos.jpg" alt="" /></a>
  44.         <script type="text/javascript">
  45.         var as = document.getElementsByTagName(‘a’);
  46.         for( var i=0; i<as.length; i++ )
  47.         {
  48.                 as[i].onclick = function()
  49.                 {
  50.                         return false;
  51.                 }
  52.         }
  53.         </script>
  54. </body>
  55. </html>

ou seja, o script antes do fechamento do , após todo o HTML, será executado assim que o navegador terminar de ler todo o conteudo em texto, e o script no , condicionado ao window.onload, só rodará qndo o documento tiver completamente carregado. Testa ai

junho 11th 2010 Não Classificados