jquery issue and hardcoding tips

Permalink 1 user found helpful
Hi
is there anybody out there who can help me get this to work:
http://174.120.180.58/~teamefx/roicatalysts/...

I know it is an issue with jquery being called twice but I have no clue what to do about it. Maybe an easy fix for a javascript expert?

Thank you so much for looking into it.

Alexander

(I would also love to hardcode superfish drop down menu in this site but have no clue how to do that... any threads that I should read?)

shotrox
 
shotrox replied on at Permalink Reply
shotrox
oh... I forgot to mention what is not working.

The big black window (a video when you go to page) is a javascript slider and it should be possible to click one of the nav buttons on the left side of it to go to another slide.

It works fine without the header_required include but as soon as I put that in it does not work anymore. I understand that header_required calls for jquery and that that is the issue but how do I fix it?

Thanks again for helping :-)
jordanlev replied on at Permalink Best Answer Reply
jordanlev
Since header_required calls jquery, and you are also including your own copy of jquery, the solution is to NOT include your own copy of jquery. Somewhere in your theme files you have something like this:
<script type="text/javascript" src="<?php echo $this->getThemePath(); ?>/js/jquery-1.3.2.min.js"></script>

Delete it.


Also, move the "<?php Loader::element('header_required'); ?>" line so it is ABOVE your own javascript lines, otherwise you will be pulling in jquery plugins before header_required loads the base jquery library (which will cause them to fail).
joemc replied on at Permalink Reply
joemc
I'm having issues with including external jquery scripts... Here is my header:
<?php $current_page = $c->getCollectionName(); ?>
<!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=UTF-8" />
<link rel="stylesheet" type="text/css" href="<?php echo $this->getStyleSheet('css/reset_custom.css'); ?>"/>
<link rel="stylesheet" type="text/css" href="<?php echo $this->getStyleSheet('main.css'); ?>"/>
<?php
// If not in edit mode, add nivo slider css
global $c;
if ( $c->isEditMode() ) { ?>
   <link rel="stylesheet" type="text/css" href="<?php echo $this->getStyleSheet('css/edit-mode.css'); ?>"/>
<?php } else { ?>
   <link rel="stylesheet" type="text/css" href="<?php echo $this->getStyleSheet('css/nivo-slider.css'); ?>"/>
<?php } ?>


I keep getting this error (in Firebug or other developer tools):
'Uncaught TypeError: Property '$' of object [object DOMWindow] is not a function'
at 'ccm.dialog.js:444

If I comment out or delete the lines for my external scripts, these errors go away. What am I doing wrong?

Thanks!
joemc replied on at Permalink Reply
joemc
Nevermind, I figured it out right after posting.

I was using:
var $j = jQuery.noConflict();


In my files to resolve any conflicts... but that seemed to cause the conflict. So, I just took that out and went back to using '$' instead of '$j' in my files.
shotrox replied on at Permalink Reply
shotrox
thank you so much - that was too easy... I tried this before but had deleted too much stuff. Now it works! Fantastic!

Now I have to figure out how to add an auto nav drop down menu so it looks like the one from the original site... any help?
jordanlev replied on at Permalink Reply
jordanlev