Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'colors'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 1 result

  1. Hi, My product page (output) in HTML is something like this: ProductImage1 ProductImage2 ProductImage3 ProductImage4 Color1 Color2 Color3 Color4 Color2 Color5 Color6 What I'm trying to do is when I hover my mouse over any color above, an original (main) image of ProductImage will switch to another image (to match the hovered color). And that original image will be back when the mouse leaves. Example: http://jsfiddle.net/4dK2x/27/ I also added another hover function on ProductImage for switching images between front view and back view and it's working well. (You would see the two src attributes of the .main class image in my php code as follows) However, the hover function on colors is not working when I run php code to create a dynamic list. Here are my category.php. ---- $sql = mysqli_query($db_connect, "SELECT p.id,p.style,c.color_palette, GROUP_CONCAT(DISTINCT CONCAT(c.color_palette) ORDER BY p.id SEPARATOR '+') color_palettes FROM product_details AS pd INNER JOIN products AS p ON p.id=pd.product_id INNER JOIN colors AS c ON c.id=pd.color_id INNER JOIN subcategories AS sub ON sub.id=p.subcategory_id INNER JOIN categories AS cat ON cat.id=sub.category_id WHERE category='$category' GROUP BY p.id LIMIT 6"); [...] $i= 0; $Output= '<table><tr>'; while($row = mysqli_fetch_array($sql, MYSQLI_ASSOC)){ $id = $row["id"]; $color_palette = $row["color_palette"]; $style = $row["style"]; $color_palettes = explode("+", $row["color_palettes"]); $Output.= '<td><div class="image"><a href="product.php?id='.$id .'&colorpalette='.$color_palette.'"><img class="main" data-alt-src="images/'.$style.'.'.$color_palette.'.BR.jpg" src="images/'.$style.'.'.$color_palette.'.FR.jpg" width="300" height="327"/></a><br />'; $Output.= '<div class="toggles">'; for ($ii=0;$ii<count($color_palettes);$ii++){ if (count($color_palettes) > 1) { $Output.= '<a href="product.php?id='.$id .'&colorpalette='.$color_palettes[$ii].'"><img data-src="images/'.$style.'.'.$color_palettes[$ii].'.FR.jpg" src="images/'.$style.'.'.$color_palettes[$ii].'.CP.jpg" /></a> '; } else { $Output.= '';} } // End for loop $Output.= '</div>'; $Output.='</div></td>'; $i++; if ($i%4==0){ $Output.= '</tr><tr>';} } // End while loop $Output.= '</tr></table>'; ---- I think my problem is probably because the array $color_palettes[$ii] is not defined in .main class image. So if that i the case, what do I do to fix it? Any help would be much appreciated.
×
×
  • Create New...