Jump to content

Is this done with Javascript?


Caitlin-havener

Recommended Posts

I want to make the user be able to click the image of the product and have it show a larger image in the same window. In the following link click on the picture of the baby carrier to see what I am talking about http://www.ergobabycarriers.com/babycarriers/item/BC4SIs this done with Javascript? If not where do I need to be looking for resources?

Link to comment
Share on other sites

this site is simply linking the image itself. when you click it its simply download the image.<a href="somesite/somefolder/picture.jpg"><img src="somesite/somefolder/picture.jpg" /><a>there is onclick event if you want to do something on click on any element. if you want to change/enlarge the picture on same window you can set a event which will increase its height and width on mouse click.

Link to comment
Share on other sites

this site is simply linking the image itself. when you click it its simply download the image.<a href="somesite/somefolder/picture.jpg"><img src="somesite/somefolder/picture.jpg" /><a>there is onclick event if you want to do something on click on any element. if you want to change/enlarge the picture on same window you can set a event which will increase its height and width on mouse click.
err...I'm not sure that's entirely accurate, unless we're talking about two different things. I believe the OP is referring to the popup window that opens when you click (at least for me the image of the backpack on the page linked). Although there is no javascript attached to the element itself, a quick glance at the link in the source shows this:
<a id="thumb1" href="/mas_assets/images/BC4S/detail.jpg" rel="facebox"><img src="/mas_assets/images/BC4S/large.jpg" alt="Cranberry baby carrier" title="Click to enlarge" /></a>

we see that there is a link 'rel'-ation with something called facebox. Looking at the javascript includes we see this:

<script type="text/javascript" src="/jcarousel/lib/jquery-1.2.1.pack.js"></script>	<script type="text/javascript" src="/jcarousel/lib/jquery.jcarousel.js"></script> <script type="text/javascript" src="/facebox/facebox.js" ></script>   //<--- FACEBOX!  <script type="text/javascript" src="/javascripts/cycle/cycle.js" ></script> <script type="text/javascript" src="/javascripts/newsticker/newsticker.js"></script> <script type="text/javascript" src="/javascripts/popupwindow/jquery.popupwindow.js"></script> <script type="text/javascript" src="/javascripts/pngFix/jquery.pngFix.js"></script>

and here's some information for the rel attributehttp://en.wikipedia.org/wiki/Link_relationhttp://www.w3schools.com/TAGS/att_link_rel.asphttp://www.w3schools.com/TAGS/att_a_rel.aspso, the long answer now makes way for the short answer, and that is yes, they are using javascript, and the answer is in the file facebox.jshttp://www.ergobabycarriers.com/facebox/facebox.js

Link to comment
Share on other sites

err...I'm not sure that's entirely accurate, unless we're talking about two different things. I believe the OP is referring to the popup window that opens when you click (at least for me the image of the backpack on the page linked). Although there is no javascript attached to the element itself, a quick glance at the link in the source shows this:
actualy when i had clicked in the morning it did not open any popup window. it directly taken me to the image. probably i did something wrong(i have bad habbit to do right click on links and open in tab) cause it is now opening a popup on direct click.my bad!
Link to comment
Share on other sites

actualy when i had clicked in the morning it did not open any popup window. it directly taken me to the image. probably i did something wrong(i have bad habbit to do right click on links and open in tab) cause it is now opening a popup on direct click.my bad!
happens to the best of us :)
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...