D
D
DoubleWish2013-11-20 22:04:26
PHP
DoubleWish, 2013-11-20 22:04:26

How to make javascript integration into joomla component module (Iprice Calculator Light)?

Hello. Can't place jquery correctly inside component. Its task is to hide the next tr or a specific id upon request in the code. Those. by clicking on one

<?php
//no direct accees
header('Content-Type: text/html;charset=UTF-8');
defined ('_JEXEC') or die ('resticted aceess');
require_once(dirname(__FILE__).DS.'lib'.DS.'helix.php');
?>
<!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" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language;?>" >
<head>
  <?php
    $helix->loadHead();
    $helix->addCSS('template.css,joomla.css,custom.css,modules.css,typography.css,css3.css');
    if ($helix->getDirection() == 'rtl') $helix->addCSS('template_rtl.css');
    $helix->getStyle();
    $helix->favicon('favicon.ico');
  ?>
<script>
  $(function() {
    $( "#accordion" ).accordion();
  });
  </script>
</head>
<?php $helix->addFeature('ie6warn'); ?>
<body class="bg clearfix">
  <div class="sp-wrap clearfix">
    <?php $helix->addFeature('toppanel'); ?>
    <div id="header" class="clearfix">
      <?php $helix->addFeature('logo') /*--- Add logo ---*/?>	
      <div id="rightcol" class="clearfix">
        <?php $helix->addFeature('fontsizer'); /* Font sizer */?>	

        <?php if ($helix->countModules('search')) { /*--- Search Module ---*/?>
          <div id="search" class="clearfix">
            <jdoc:include type="modules" name="search" />
          </div>
        <?php } ?>	
      </div>	
    </div>	

    <div id="SOME" class="clearfix">
            <?php if($helix->countModules('top-menu')) { /*--- top-menu ---*/?>	
          <div id="top-menu" class="clearfix">
            <jdoc:include type="modules" name="top-menu" />			
          </div>
<script type="text/javascript">
  $(document).ready(function(){
    var link = window.location.pathname;
    $('.menu li a[href="'+link+'"]').parent().addClass('active');
  });
</script>				
          <div class="clr"></div>	
        <?php } ?>	
        
    </div>
    <?php if($helix->countModules('slides')) { /*--- Module position slides ---*/?>	
      <div id="slides" class="clearfix">
        <jdoc:include type="modules" name="slides" />			
      </div>				
    <?php } ?>	
  
    <!--Module Position user1 to user6-->
    <?php if($mods= $helix->getModules('user1,user2,user3,user4,user5,user6')) { ?>
      <div id="sp-userpos" class="clearfix">
        <div class="sp-inner">
          <?php $helix->renderModules($mods,'sp_flat');?>
        </div>
      </div>
    <?php } ?>
    
    <div class="main-padding clearfix">
    <?php $helix->loadLayout(); ?>
    
    <!--Module Position carousel-->
    <?php if($mods= $helix->getModules('carousel')) { ?>
      <div id="sp-carousel" class="sp-inner">
        <?php $helix->renderModules($mods,'sp_none');?>
      </div>
    <?php } ?>

    <!--Module Position mid1 and mid2-->
    <?php if($helix->countModules('mid1 or mid2')) { ?>
      <div id="mid-pos">
        <?php if($helix->countModules('mid1')) { ?>
          <div id="mid1" class="clearfix">
            <div class="sp-inner">
              <jdoc:include type="modules" name="mid1" style="sp_xhtml" />	
            </div>						
          </div>						
        <?php } ?>
        <?php if($helix->countModules('mid2')) { ?>
          <div id="mid2" class="clearfix">
            <div class="sp-inner">
              <jdoc:include type="modules" name="mid2" style="sp_xhtml" />			
            </div>						
          </div>						
        <?php } ?>
      </div>
    <?php } ?>
    </div>
  
    <!--Module Position breadcrumbs-->
    <?php if($helix->countModules('breadcrumbs')) { ?>
      <div class="clr"></div>
      <div id="breadcrumbs" class="sp-inner clearfix">
        <a id="breadcrumb-home" href="<?php echo $this->baseurl?>"></a> <jdoc:include type="modules" name="breadcrumbs" />
        <?php $helix->addFeature('totop') ?>
      </div>	
    <?php } ?>
    
    <!--Module Position bottom1 to bottom6-->
    <?php if($mods= $helix->getModules('bottom1,bottom2,bottom3,bottom4,bottom5,bottom6')) { ?>
      <div id="sp-bottom" class="clearfix">
        <div class="sp-inner">
          <?php $helix->renderModules($mods,'sp_flat');?>
        </div>
      </div>
    <?php } ?>
    <div id="jsn-pos-stick-rightmiddle">
      <jdoc:include type="modules" name="stick-rightmiddle" />
    </div>
    
    <!--Footer-->
    <div id="sp-footer" class="clearfix">
      <div class="cp">
        <?php $helix->addFeature('copyright') /*--- Show copyright ---*/?>
        <?php if ($helix->countModules('footer-nav')) /*--- Module position footer-nav ---*/{ ?>
          <div id="footer-nav">
            <jdoc:include type="modules" name="footer-nav" />
          </div>
        <?php } ?>	
      </div>		
      <div class="clearfix">				
        <div class="brand">
          <?php $helix->addFeature('brand') /*--You are not allowed to remove or modify brand link. You need to purchase copyright removal license from http://www.joomshaper.com/copyright-removal-license in order to remove this link.--*/ ?>	
        </div>
        <div class="validator">
          <?php $helix->addFeature('jcredit') /*--- Joomla credit link ---*/?>
          <?php $helix->addFeature('validator') /*--- CSS and XHTML validator ---*/?>
        </div>
      </div>
    </div>
  </div>
  
  <div class="clr"></div>
  <?php $helix->addFeature('helixlogo'); /*--- Helix logo ---*/?>		
  
  <?php $helix->addFeature('analytics'); /*--- Google analytics tracking code ---*/?>
  <?php $helix->addFeature('jquery'); /*--- Load jQuery library ---*/?>
  <?php $helix->addFeature('ieonly'); /*--- IE only Feature ---*/?>
  <?php $helix->compress(); /* --- Compress CSS and JS files --- */ ?>	
  <?php $helix->getFonts() /*--- Standard and Google Fonts ---*/?>	
  
  <jdoc:include type="modules" name="debug" />
  
</body>
</html>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freelook00, 2013-11-21
@ZeroPT

In Joomla JS scripts, $ can be answered by MooTools, while jQuery works in noConflict mode.
In this case, jQuery functions can be accessed through a jQuery variable instead of $.
http://api.jquery.com/jQuery.noConflict/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question