Boa Noite Pessoal.
No arquivo submenu.js tenho as seguintes funções utilizando jquery:
$(function() {
$( "#bt_news" ).toggle(
function() {
$( "#news" ).animate({
backgroundColor: "#1C86EE",
color: "#fff",
height: 150
}, 1000 );
},
function() {
$( "#news" ).animate({
backgroundColor: "#fff",
color: "#000",
height: 37
}, 1000 );
}
);
$( "#bt_mais" ).toggle(
function() {
$( "#mais" ).animate({
backgroundColor: "#1C86EE",
color: "#fff",
height: 150
}, 1000 ),
$("#webmail").css('visibility','visible');
},
function() {
$( "#mais" ).animate({
backgroundColor: "#fff",
color: "#000",
height: 37
}, 1000 ),
$( "#webmail" ).animate({
backgroundColor: "#fff",
color: "#000",
height: 0
}, 1000 ),
$("#webmail").css('visibility','hidden');
}
);
$( ".column" ).sortable({
connectWith: ".column"
});
$( ".portlet" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
.find( ".portlet-header" )
.addClass( "ui-widget-header ui-corner-all" )
.prepend( "<span class='ui-icon ui-icon-minusthick'></span>")
.end()
.find( ".portlet-content" );
$( ".portlet-header .ui-icon" ).click(function() {
$( this ).toggleClass( "ui-icon-minusthick" ).toggleClass( "ui-icon-plusthick" );
$( this ).parents( ".portlet:first" ).find( ".portlet-content" ).toggle();
});
$( ".column" ).disableSelection();
});
$(document).ready(
$( "#news" ).animate({
backgroundColor: "#1C86EE",
color: "#fff",
height: 150
}, 1000 ),
$( "#mais" ).animate({
backgroundColor: "#1C86EE",
color: "#fff",
height: 150
}, 1000 ),
$("#webmail").css('visibility','visible'));
Se os scripts forem declarados dentro da pagina eles funcionam normalmente:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>MobTudo - Soluções</title>
<link href="styles/estilos.css" rel="stylesheet" type="text/css" />
<link href="styles/posicionamento.css" rel="stylesheet" type="text/css"/>
<link href="styles/rodape_conteudo.css" rel="stylesheet" type="text/css"/>
<link href="jquery/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css"/>
<link href="jquery/demos.css" rel="stylesheet" type="text/css"/>
<script src="scripts/submenu.js"></script>
<script src="jquery/jquery-1.6.2.js"></script>
<script src="jquery/ui/jquery.effects.core.js"></script>
<script src="jquery/ui/jquery.ui.widget.js"></script>
<script src="jquery/ui/jquery.ui.mouse.js"></script>
<script src="jquery/ui/jquery.ui.sortable.js"></script>
<style>
.column { width: 170px; float: left; padding-bottom: 100px; margin-top: 3px; }
.portlet { margin: 0 1em 1em 0; }
.portlet-header { margin: 1pt; padding-bottom: 4px; padding-left: 0.2em; }
.portlet-header .ui-icon { float: right; }
.portlet-content { padding: 0.4em; }
.ui-sortable-placeholder { border: 1px dotted black; visibility: visible !important; height: 50px !important; }
.ui-sortable-placeholder * { visibility: hidden; }
</style>
<script>
/* function sub_menu()
{
$( "#news" ).animate({
backgroundColor: "#1C86EE",
color: "#fff",
height: 150
}, 1000 ),
$( "#mais" ).animate({
backgroundColor: "#1C86EE",
color: "#fff",
height: 150
}, 1000 ),
$("#webmail").css('visibility','visible');
}
$(function() {
$( "#bt_news" ).toggle(
function() {
$( "#news" ).animate({
backgroundColor: "#1C86EE",
color: "#fff",
height: 150
}, 1000 );
},
function() {
$( "#news" ).animate({
backgroundColor: "#fff",
color: "#000",
height: 37
}, 1000 );
}
);
$( "#bt_mais" ).toggle(
function() {
$( "#mais" ).animate({
backgroundColor: "#1C86EE",
color: "#fff",
height: 150
}, 1000 ),
$("#webmail").css('visibility','visible');
},
function() {
$( "#mais" ).animate({
backgroundColor: "#fff",
color: "#000",
height: 37
}, 1000 ),
$( "#webmail" ).animate({
backgroundColor: "#fff",
color: "#000",
height: 0
}, 1000 ),
$("#webmail").css('visibility','hidden');
}
);
$( ".column" ).sortable({
connectWith: ".column"
});
$( ".portlet" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
.find( ".portlet-header" )
.addClass( "ui-widget-header ui-corner-all" )
.prepend( "<span class='ui-icon ui-icon-minusthick'></span>")
.end()
.find( ".portlet-content" );
$( ".portlet-header .ui-icon" ).click(function() {
$( this ).toggleClass( "ui-icon-minusthick" ).toggleClass( "ui-icon-plusthick" );
$( this ).parents( ".portlet:first" ).find( ".portlet-content" ).toggle();
});
$( ".column" ).disableSelection();
});
*/
</script>
</head>
<body>
<!--Redes Sociais-->
<div>
<?php
include 'social.php';
?>
</div>
<div id="corpo_pagina">
<!--Cabeçalho-->
<?php
include 'cabecalho_menu.php';
?>
<div id="sub_menu">
<!--Mais-->
<div id="mais" class="ui-widget-content ui-corner-all" >
<a > <h3 class="ui-widget-header ui-corner-all">Mais</h3></a>
<div id="webmail">
<a href="http://mobtudo.com:2095/3rdparty/roundcube/?_task=mail" > <input type="image" src="images/body/webmail.png"/><div style="font:bold 14px sans-serif; color: #FFD700; ">Webmail</div></a>
</div>
</div>
<!--News-->
<div id="news" class="ui-widget-content ui-corner-all">
<a > <h3 class="ui-widget-header ui-corner-all">News</h3></a>
<!--<div id="column" class="column" style="visibility: hidden">
<div class="portlet">
<div class="portlet-header">Feeds</div>
<div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
</div>
</div >
<div id="column" class="column" style="visibility: hidden">
<div class="portlet">
<div class="portlet-header">Images</div>
<div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
</div>
</div> -->
</div>
</div>
<!-- corpo -->
<div id="conteudo">
</div>
<!--Rodape-->
<?php
include 'rodape.php';
?>
</div>
</body>
</html>
Criei uma simples função e debuguei com o firebug normalmente(apenas para validar se eu estava acessando o arquivo) e entrou normalmente, as funções que estão
no arquivo submenu.js não funcionam. O que pode ser?