I am still new to script, this my be a simple question.
On the site I am building right now I have some small script functions that work great, but when I linked in jQuery for a different function the first ones stopped working. If I remove the jQuery link they work again.
Here is the functions that I have currently:
This one is the one I need jQuery for, <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
// ~~~~~~~~~~ Header Background image rotation ~~~~~~~~~~ \\
$(document).ready(function(){
var header = $('.mainheader');
var backgrounds = new Array(
'url(img/rainbow.jpg)'
, 'url(img/chicks_on_grass.jpg)'
, 'url(img/cattle_on_pasture.jpg)'
, 'url(img/csa_bundle.jpg)'
);
var current = 0;
function nextBackground() {
current++;
current = current % backgrounds.length;
header.css('background-image', backgrounds[current]);
}
setInterval(nextBackground, 10000);
header.css('background-image', backgrounds[0]);
});
This next function still works normally
// ~~~~~~~~~~ ShowOrHide Element Onclick ~~~~~~~~~~ \\
function showOrHide(zap) {
if (document.getElementById) {
var abra = document.getElementById(zap).style;
if (abra.display == "block") {
abra.display = "none";
} else {
abra.display = "block";
}
return false;
} else {
return true;
}
}
This one does not work any more
// ~~~~~~~~~~ Form Email Hint ~~~~~~~~~~ \\
JotForm.init(function(){
$('input_4').hint('ex: myname@example.com');
});
All three of these functions are enclosed in <script language="JavaScript"></script>
tag.
Then I have a third party JavaScript link that controls some things on a form that I have on the site. <script src="http://max.jotfor.ms/min/g=jotform?3.1.1667" type="text/javascript"></script>
This does not work alongside the JQuery either.
I have no idea what is going on, spent all day working on it. Any help is appreciated.