yet when i addd the html code in the page when i preview it there is no jquery in motion.
Does anyone have an idea of where i am going wrong? This is my first attempt at adding jquery in wordpress without using a wordpress plugin. Just noticed this thread is in the CSS Section. Not sure why!
i have included my own JS in the header
NONE OF MY JQUERY SCRIPTS WORK IN WORDPRESS I DONT KNOW WHY
here is the page http://khaledstudios.com/?page_id=11
all there is, is a link there that says click me
and here is the JS
this sould work i dont know why it isnt.
you have this
$('a').click(functino(event) {
i am sure it's suppose to be this
$('a').click(function(event) {
1. Include the jquery library into the head section of your code
<script type="text/javascript" src="jquery-1.2.6.min.js"></script> //Make sure to download this version from the jquery site.
2. Change you code to this
<script type="text/javascript">
$(function(){
$("a").click(function(){
alert("abc");
});
});
</script>
Notice the change from single quotes to double
thx for your guys help
I have added
and linked to my script just under
Here is the jquery file
function initMenus() {
$('ul.menu ul').hide();
$.each($('ul.menu'), function(){
$('#' + this.id + '.expandfirst ul:first').show();
});
$('ul.menu li a').click(
function() {
var checkElement = $(this).next();
var parent = this.parentNode.parentNode.id;
if($('#' + parent).hasClass('noaccordion')) {
$(this).next().slideToggle('normal');
return false;
}
if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
if($('#' + parent).hasClass('collapsible')) {
$('#' + parent + ' ul:visible').slideUp('normal');
}
return false;
}
if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
$('#' + parent + ' ul:visible').slideUp('normal');
checkElement.slideDown('normal');
return false;
}
}
);
}
$(document).ready(function() {initMenus();});
yet when i addd the html code in the page when i preview it there is no jquery in motion.
Does anyone have an idea of where i am going wrong?
This is my first attempt at adding jquery in wordpress without using a wordpress plugin.
Just noticed this thread is in the CSS Section. Not sure why!
Thanks