Advertisement

10.07.2008 at 12:38PM PDT, ID: 23795026
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.1

Trying to manipulate Javascript DOM to move product name

Asked by MikeZ_LaFrance in JavaScript, Dynamic HTML (DHTML)

Tags: ,

Hello,

I currently have a rough design of a scroll bar that displays thumbnails of various products with their product names. I am trying to move the product names from to the right of the corresponding thumbnail, to directly below the thumbnail.  I was thinking of nesting a <div> tag within another <div> tag so that the product name would be placed directly below the thumbnail, but I am not having much luck with it. Can anyone show me how? or does anyone have a more efficient way of doing it?

Thanks!Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
<?php
$heading='Product Viewer';
 
require './include/prodview_common.php';
 
$totalimages=0;
$product='';
$productArray = array();
$productDescriptionArray = array();
//if(isset($_GET['name'])) {
    $product=$_GET['name'];
    if(($link=mysql_connect("xxx.xxxx","xxxxx","xxxx"))!=false) {
        if(mysql_select_db("ptcommerce_products")!=false) {
            $result=mysql_query("SELECT PRODUCT_ID, TYPE FROM new_products");
            $totalimages = mysql_num_rows($result);
            while ($tempProd = mysql_fetch_row($result))
                {
                    array_push($productArray, $tempProd[0]);
                    array_push($productDescriptionArray,  $tempProd[1]);
                }
            
        } else
            echo "FAILURE!!";
        mysql_close($link);
    } 
    else 
        echo "Could not connect"; 
    
 
 
//echo str_replace("-", "/-", $product);
 
//$filestem=preg_replace('/[^a-z|0-9]++/i','', $product);
 
$filestem = $product;
$index=@$_GET['index'];
if($index<1) $index=1; elseif($index>$totalimages) $index=$totalimages;
 
$numberArray=array();
$zeroFill='0';
while($i<$totalimages) {
    $i++;
    if($i==10) $zeroFill='';
    $numberArray[$i]=$zeroFill.$i;
}
 
outputHeaderBegin($heading,2);
//echo '<link rel=stylesheet type="text/css" href="/css/product.css">';
echo '<script type="text/javascript" src="/js/lib/imageViewerJB.js"></script>';
echo '<script type="text/javascript">';
    echo 'var imageViewer;';
    echo 'function initialize() {';
        echo 'imageViewer={'.
            'callbackPeriod:80,'.
            'fixedPointPlaces:2,'.
            'velocityDecayShift:2,'.
            'driftSpeed:3,'.
            'thumbHeight:64,'.
            'thumbWidth:64,'.
            'thumbSeperator:2,'.
            'thumbBackgroundColor:\'white\','.
            'thumbBorderThickness:2,'.
            'thumbBorderColor:\'black\','.
            'selectedBorderThickness:3,'.
            'selectedBorderColor:\'blue\','.
            'hoverBorderColor:\'#BD2226\','.
            'emptyThumbColor:\'#666666\','.
            'emptyThumbImage:\'/images/style/empty.gif\','.
            'scrollBlock:document.getElementById(\'scrollBlock\'),'.
            'scrollBlock:document.getElementById(\'scrollBlock2\'),'.
            'viewImgTag:document.getElementById(\'viewImgTag\'),'.
            'arrowLeftImgTag:document.getElementById(\'arrowLeftImgTag\'),'.
            'arrowRightImgTag:document.getElementById(\'arrowRightImgTag\'),'.
            'arrowLeftImages:[\'/images/style/leftArrowDi.gif\',\'/images/style/leftArrow.gif\',\'/images/style/leftArrowHi.gif\'],'.
            'arrowRightImages:[\'/images/style/rightArrowDi.gif\',\'/images/style/rightArrow.gif\',\'/images/style/rightArrowHi.gif\'],'.
            'thumbImages:[';
        foreach($productArray as $product) echo '\'http://10.1.0.2/Plastic-Enclosures-Thumbs/'.$product.'.jpg\',';
        echo '\'\'],viewImages:[';
        foreach($productArray as $product) echo '\'http://10.1.0.2/Plastic-Enclosures-Thumbs/'.$product.'.jpg\',';
        echo '\'\'],totalImages:'.$totalimages.','.'currentImage:'.$index.',';
        echo 'link_url:[';
        foreach($productArray as $product) echo '\'http://10.1.0.2/Plastic-Enclosures/'.$product.'.html\',';
        echo '\'\'],';
         echo 'link_text:[';
        foreach($productArray as $product) echo '\''.$product.'\',';
        echo '\'\'],';
        echo 'link_description:[';
        foreach($productDescriptionArray as $product) echo '\''.$product.'\',';
        echo '\'\']';
        echo '};';
        
 
        
        
        echo 'initializeImageViewer.call(imageViewer);';
    echo '}';
echo '</script>';
outputHeaderEnd('onload="initialize();"',1);
outputFormatWideCenterStart();
 
echo '<table ><tr>';
echo '<td  valign=top colspan=2>';
    echo '<table style="width:100%;"><tr>';
    echo '<td style="width: 32px;border:1px solid black;"><img id=arrowLeftImgTag style="cursor:pointer;" src="/images/style/leftArrowDi.gif" alt=""></td>';
    echo '<td align=left style="border:1px solid black;"><div id=scrollBlock style="height:92px;width:600px;"><div id=scrollBlock2 style="height:50px;width:50px;"></div></div></td>';
    echo '<td style="width: 32px;border:1px solid black;"><img id=arrowRightImgTag style="cursor:pointer;" src="/images/style/rightArrowDi.gif" alt=""></td>';
    echo '</tr></table>';
    echo '<p style="clear:both;"><font face="Arial">New Products: Click on the product name to goto the product page.</font></p>';
echo '</td></tr><tr><td class=imageBox align=center valign=middle colspan=2>';
    echo '<img id=viewImgTag src="/images/style/empty.gif" alt="">';
echo '</td></tr></table>';
Attachments:
 
The javascript function to create the scrollbar that the php references
 
 
Loading Advertisement...
 
[+][-]10.08.2008 at 01:17AM PDT, ID: 22667003

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 04:42AM PDT, ID: 22667929

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 05:31AM PDT, ID: 22668259

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 05:42AM PDT, ID: 22668350

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: JavaScript, Dynamic HTML (DHTML)
Tags: Java Script, Internet Explorer 7
Sign Up Now!
Solution Provided By: mplungjan
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_2_20070628