Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-28-2012, 03:00 AM   PM User | #1
Inxie
New Coder

 
Join Date: Jul 2011
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Inxie is an unknown quantity at this point
Gallery thumbnail distortion

I have a Jquery gallery on my product page, it uses the following code to work:

Code:
<script language="javascript">
$(document).ready(
function (){
$("#pikame").PikaChoose({carousel:true,carouselOptions:{wrap:'circular'}});
});
</script>

Code:
<div id="pikawrapper"><div class="pikachoose"> 
<?php 
if (sizeof($images_array) > 0) { 
?> 
<ul id="pikame" class="jcarousel-skin-pika"> 
<?php  
  for($img=0; $img<sizeof($images_array); $img++) { 
    echo '<li>' . zen_image('images/' . $images_array[$img]) . '</li>'; 
  } ?> 

</ul> 
<?php } ?> 
</div></div>
Here's a link to a product page with this implemented.
http://www.pazzle.co.uk/index.php?ma...&products_id=3

If you notice, the thumbnails of the images are distorted and I have no idea why. Any ideas on how to fix this?
Inxie is offline   Reply With Quote
Old 09-28-2012, 08:14 AM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
Your <img> elements seem to have fixed width and height attributes ... you should remove at least the width so that it can fit into the thumbnail area.
devnull69 is offline   Reply With Quote
Old 09-28-2012, 08:39 AM   PM User | #3
Inxie
New Coder

 
Join Date: Jul 2011
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Inxie is an unknown quantity at this point
But where is this fixed width being defined?
Inxie is offline   Reply With Quote
Old 09-28-2012, 08:42 AM   PM User | #4
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
Here
Code:
<div id="pikawrapper"><div class="pikachoose"> 
 
<ul id="pikame" class="jcarousel-skin-pika">

<li><img src="images/technojunkie_01.gif" alt="" width="545" height="539" /></li>
<li><img src="images/technojunkie_02.gif" alt="" width="545" height="539" /></li>
<li><img src="images/technojunkie_03.gif" alt="" width="545" height="539" /></li> 

</ul> 
 
</div>
devnull69 is offline   Reply With Quote
Old 09-28-2012, 09:14 AM   PM User | #5
Inxie
New Coder

 
Join Date: Jul 2011
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Inxie is an unknown quantity at this point
Im sorry for being a newbie but what file is that code in?

I have never seen that code, it must be compiled on page load because I have never set a width.
Inxie is offline   Reply With Quote
Old 09-28-2012, 09:32 AM   PM User | #6
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
Sorry I can't tell you that. What is your HTML for the images then?
devnull69 is offline   Reply With Quote
Old 09-28-2012, 10:07 AM   PM User | #7
Inxie
New Coder

 
Join Date: Jul 2011
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Inxie is an unknown quantity at this point
There is no HTML, it's all done through Javascript.

I am using Zen cart, it creates it's own image array and I have the gallery source images through that array.

see...
Code:
  for($img=0; $img<sizeof($images_array); $img++) { 
    echo '<li>' . zen_image('images/' . $images_array[$img]) . '</li>';
Inxie is offline   Reply With Quote
Old 09-28-2012, 10:12 AM   PM User | #8
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
Then you'll have to check if Zen creates the images with fixed width ...

You can easily find out if you disable every dynamic Javascript changes to the page and then check the page HTML in your browser.
devnull69 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:05 PM.


Advertisement
Log in to turn off these ads.