astima
Member
Posted 6 months ago #
I have almost resolved my jquery UI issue. The only problem I am having is that I was told to place this code in my header`<script>
$(function(){
$('#flip').jcoverflip();
});
</script>
`
When I look in firebug the error I get says: $ is not define
I have tried changing $ to Jquery thinking that might help that it made no difference. Why is $ not defined?
astima
Member
Posted 6 months ago #
okay, so I read through the file and I have done those things. I had a working on this for three days. And the only error message I have left to address is: $ is not define
here is a page of a site where I am trying to use Jquery:http://www.stimadesigns.com/hunterdondistributors/our-portfolio/beer-2/
if you cannot help me I would really appreciate if you point me to someone who can. I am really trying hard to make this work.
thanks
astima
Member
Posted 6 months ago #
here is the function that only included in my functions.php
function my_scripts_method() {
// Change the uri to where jquery.jcoverflip.js is at.
wp_register_script('jcover', ''.get_template_directory_uri().'/scripts/js/jquery.jcoverflip.js', 'jquery');
wp_enqueue_script( 'jcover' );
wp_enqueue_script('jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js', array('jquery'), '1.8.16');
wp_enqueue_script('jcoverflip');
}
add_action('wp_enqueue_scripts', 'my_scripts_method');
?>
prior to adding this function I was having issues these scripts were not loading. But now they do and the only error message I have left is about $. could it be an issue with the Jquery noconflict?
astima
Member
Posted 6 months ago #
is that in a yes to it could be an issue with Jquery noconflict?
Yes it is. Don't use the $. Use jQuery().
It's explained on the wp_enqueue_script() page esmi linked to. Specifically the "jQuery noConflict wrappers" section.
http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_wrappers
astima
Member
Posted 6 months ago #
No matter what I write this bit of code is giving me trouble. I have written it every way article suggests. what else could it be?
<script>
jQuery(document).ready(function(){
jQuery('#flip').jcoverflip();
});
</script>