Difference: JavaScript (1 vs. 3)

Revision 316 Jul 2010 - FlavioAraujo

Line: 1 to 1
 
%STARTINCLUDE%
<script type="text/javascript" src="/twiki/pub/Quimica/JavaScript/jquery.js"></script>
Line: 9 to 9
 var tout;

$("document").ready(function(){

Changed:
<
<
$("#menu").children("ul").children("li").children("a").mouseenter(function(){ $(this).parents("li").children("ul").toggle();
>
>
$("#menu ul li").mouseenter(function(){ $(this).children("ul").toggle(); $(this).css("background-color", "#b37d46");
  });
Changed:
<
<
$("#menu").children("ul").children("li").children("a").mouseleave(function(){ $(this).parents("li").children("ul").toggle();
>
>
$("#menu ul li").mouseleave(function(){ $(this).children("ul").toggle(); $(this).css("background-color", "#DD7F1F");
  });

//macra com a classe "active" o item de menu caso leve à página atual

Revision 214 Jul 2010 - FlavioAraujo

Line: 1 to 1
 
%STARTINCLUDE%
<script type="text/javascript" src="/twiki/pub/Quimica/JavaScript/jquery.js"></script>
Line: 9 to 9
 var tout;

$("document").ready(function(){

Changed:
<
<
$("#menu").children("ul").children("li").children("a").mouseEnter(function(){ if ($(this).parents("li").hasClass("expand")) { $(".expand").children("ul").slideToggle("fast"); $(".expand").removeClass("expand"); } else { $(".expand").children("ul").slideToggle("fast"); $(".expand").removeClass("expand"); $(this).parents("li").addClass("expand"); $(".expand").children("ul").find("*").show(); $(".expand").children("ul").slideToggle("fast"); }
>
>
$("#menu").children("ul").children("li").children("a").mouseenter(function(){ $(this).parents("li").children("ul").toggle(); });

$("#menu").children("ul").children("li").children("a").mouseleave(function(){ $(this).parents("li").children("ul").toggle();

  });

//macra com a classe "active" o item de menu caso leve à página atual

Revision 113 Jul 2010 - FlavioAraujo

Line: 1 to 1
Added:
>
>
%STARTINCLUDE%
<script type="text/javascript" src="/twiki/pub/Quimica/JavaScript/jquery.js"></script>
<script type="text/javascript">

var total;
var it;
var tout;

$("document").ready(function(){
  $("#menu").children("ul").children("li").children("a").mouseEnter(function(){
    if ($(this).parents("li").hasClass("expand")) {
      $(".expand").children("ul").slideToggle("fast");
      $(".expand").removeClass("expand");
    } else {
      $(".expand").children("ul").slideToggle("fast");
      $(".expand").removeClass("expand");
      $(this).parents("li").addClass("expand");
      $(".expand").children("ul").find("*").show();
      $(".expand").children("ul").slideToggle("fast");
    }
  });

  //macra com a classe "active" o item de menu caso leve à página atual
  var pagina = document.URL.substr(document.URL.lastIndexOf("/PortalPpga/"));
    if (pagina.indexOf("#") != -1) {
      pagina = pagina.slice(0,pagina.length-2)
    }
    if (pagina.lastIndexOf("/PortalPpga/") + 12 == pagina.length)
      pagina += "WebHome";
    pagina = "[href*='" + pagina + "']";
    $(pagina).parent("#menu li").addClass("active");
    $(".active").addClass("expand");
    $(".active").children("ul").slideToggle();
    $(".active").parents("ul ul").parents("li").addClass("expand");
    $(".active").parents("ul ul").slideToggle("normal");

  $("[href*='http://']").attr("target", "_blank");
  $("[href*='.pdf']").attr("target", "_blank");
});

</script>
%STOPINCLUDE%
 
This site is powered by the TWiki collaboration platformCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback