JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 8th, 2012, 07:44 PM
tech0925 tech0925 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2011
Posts: 306 tech0925 User rank is Corporal (100 - 500 Reputation Level)tech0925 User rank is Corporal (100 - 500 Reputation Level)tech0925 User rank is Corporal (100 - 500 Reputation Level)tech0925 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 18 h 23 m 55 sec
Reputation Power: 5
Pop up boxes in loop need different classes or ids??

Please see this page
http://dev.beckin.com/products.html?mode=list

I am running a loop with 10 different popup boxes being outputed on the each page. I was able to get the popup box working but when I hover over one it activates all 10 popup boxes. I know this is because I do not have a different id for each one. I know how to add a number to the end of the id popup-box by using $i++ in my loop but I dont know how to make the jquery script only activate that id. Any help or a better way of doing this would be helpful!

Here is my code:

Code:
  <div class="container">

      <a href="#" id="trigger"><img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/fortis/default/images/zoomGlass.png" alt="<?php echo $_productNameStripped ?>" /></a>

<div class="actionpop" id="pop-up">
        <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
    </div>
  </div>


Code:
    <script type="text/javascript">
      $(function() {
        var moveLeft = 20;
        var moveDown = 10;
        
        $('a#trigger').hover(function(e) {
          $('div#pop-up').show();
          //.css('top', e.pageY + moveDown)
          //.css('left', e.pageX + moveLeft)
          //.appendTo('body');
        }, function() {
          $('div#pop-up').hide();
        });
        
        $('a#trigger').mousemove(function(e) {
          $("div#pop-up").css('marginTop', -20).css('marginLeft', 60).css('z-index', 9999);
        });
        
      });
    </script>



Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Pop up boxes in loop need different classes or ids??

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap