PHP School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a PHP Expert!

Join 307,120 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,958 people online right now. Registration is fast and FREE... Join Now!




FireFox displays wrong - Explorer correctly.

 

FireFox displays wrong - Explorer correctly.

dwrlox

7 Nov, 2009 - 03:02 AM
Post #1

D.I.C Head
**

Joined: 27 Nov, 2008
Posts: 63




Hi guys

I have a little problem with my featured items, in explorer it seems to be displaying the next items correctly, nice and centerd next to each other.

In firefox i click on next and it automaticly adds a scroller and makes the items in the featured area spaced out sad.gif



CODE
<?php

$_GET['do']=="allcat" ? $Feature_width = 1000 : $Feature_width = 545;

?>

<div id="scroller_head"  style="width: <?php echo $Feature_width; ?>; overflow: hidden;">

<table width="100%" border="0" cellspacing="0" cellpadding="0">

  <tr>

    <td width="12" class="cont_tleft">&nbsp;</td>

    <td align="left" class="cont_tbg"><!--<?php echo defined('SHOWHEADING') ? SHOWHEADING: ''?>--><?php echo $localization['ENG1018'];?></td>

    <td width="11" class="cont_tright">&nbsp;</td>

  </tr>

</table>  

</div>

<div id="myscroller"  style="width: <?php echo $Feature_width; ?>; overflow: auto;">



<table border="0" cellspacing="0" cellpadding="0" width="100%">

  <tr>

    <td colspan="3" align="center" class="content_bdr"><table width="94%" border="0" cellspacing="0" cellpadding="0">

        <tr>

          <td colspan="5"><img src="images/spacer_16.gif" alt="" width="4" height="16" /></td>

        </tr>

        <tr> <div id="featitems"><span id="tt"><?php echo defined('FEATUREDLIST') ? FEATUREDLIST :''; ?></span></div> </tr>

        <tr>

          <td colspan="5" align="right" class="bestsell_txt"><table border="0" cellspacing="0" cellpadding="0">

          <tr>

          <td><span class="txt_11" id="prevnext" style="cursor:pointer"><form id="myprevnext" action="?do=allcat&id=<?php echo (int)($_GET['id']); ?>" method="get" ><input type="submit" name="prevpg" value="<< <?php echo $localization['ENG1016'];?>"> | <input type="submit" name="nextpg" value="<?php echo $localization['ENG1017']; ?> >>" ></form></span></td>

         </tr>

             </table></td>

        </tr>

      </table></td>

  </tr>

</table>

</div>

<script LANGUAGE="JavaScript">

var pg = 0;

function getHTTPObject()

{

    if (window.ActiveXObject)

        return new ActiveXObject("Microsoft.XMLHTTP");

    else if (window.XMLHttpRequest)

        return new XMLHttpRequest();

    else

    {

        //alert("Your browser does not support AJAX.");

        return null;

    }

}

function prev()

{

    pg = pg - 1;

    if(pg < 0)

        pg = 0;

    myid = "&id=<?php echo $_GET['id']; ?>&pg="+pg;

    mydir = "prevpg=go"+myid;

    getmyFeatured(mydir);

}

function next()

{

    pg = pg + 1;

    myid = "&id=<?php echo $_GET['id']; ?>&pg="+pg;

    mydir = "nextpg=go"+myid;

    getmyFeatured(mydir);

}



function getresponse()

{

    if(httpObject.readyState == 4)

    {

        mycode = '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td colspan="3" align="center" class="content_bdr"><table width="94%" border="0" cellspacing="0" cellpadding="0"><tr><td colspan="5"><img src="images/spacer_16.gif" alt="" width="4" height="16" /></td></tr><tr> <div id="featitems"><span id="tt">';



        myendcode = '</span></div> </tr><tr><td colspan="6" align="right" class="bestsell_txt"><table border="0" cellspacing="0" cellpadding="0"><tr><td></td><td></td><td></td><td><span class="txt_11" id="prevnext" style="cursor:pointer"><form id="myprevnext" ><input type="button" name="prevpg" onclick="prev()" value="<< '+"<?php echo $localization['ENG1016'];?>"+'" > | <input type="button" onclick="next()" name="nextpg" value="'+"<?php echo $localization['ENG1017']; ?>"+' >>" ></form></span></td></tr></table></td></tr></table></td></tr></table>';

        document.getElementById('myscroller').innerHTML = mycode + httpObject.responseText + myendcode;

//alert(mycode + httpObject.responseText + myendcode);

    }

}

function getmyFeatured(direction)

{

    httpObject = getHTTPObject();

    if (httpObject != null)

    {

        httpObject.open("GET", "featuredajax.php?"+direction);

        httpObject.send(null);

        httpObject.onreadystatechange = getresponse;

    }



}

x = getHTTPObject();

if(x != null)

{

    document.getElementById('myprevnext').innerHTML = '<input type="button" name="prevpg" onclick="prev()" value="<< <?php echo $localization['ENG1016'];?>"> | <input type="button" onclick="next()" name="nextpg" value="<?php echo $localization['ENG1017']; ?> >>" >';

}



</script>



<!--

             <tr>

                <td><span onclick="getFeaturedBack()" class="txt_11" id="prev" style="cursor:pointer"><< <?php echo $localization['ENG1016'];?> | </span></td>

                <td><span id="next" onclick="getFeatured()" class="txt_11" style="cursor:pointer"><?php echo $localization['ENG1017']; ?> >></span></td>

              </tr>

-->


User is offlineProfile CardPM
+Quote Post


Atspulgs

RE: FireFox Displays Wrong - Explorer Correctly.

7 Nov, 2009 - 05:28 AM
Post #2

D.I.C Head
**

Joined: 29 Jul, 2009
Posts: 174



Thanked: 16 times
My Contributions
It might be a wild guess but i would start with adding a doctype to html part.
See this

Usually html is what deals with displaying objects in the browser, with some help from css.
User is offlineProfile CardPM
+Quote Post

dwrlox

RE: FireFox Displays Wrong - Explorer Correctly.

7 Nov, 2009 - 06:18 AM
Post #3

D.I.C Head
**

Joined: 27 Nov, 2008
Posts: 63

Well in internet explorer is doesnt show a slider, in firefox it does... it must be something to do with the scroller
User is offlineProfile CardPM
+Quote Post

felixtgomezjr

RE: FireFox Displays Wrong - Explorer Correctly.

9 Nov, 2009 - 01:22 AM
Post #4

New D.I.C Head
Group Icon

Joined: 4 Nov, 2009
Posts: 42



Thanked: 3 times
Dream Kudos: 50
My Contributions
Try loading the page and click "next". Then go to error console of Firefox (cntrl-shift-J for new versions, otherwise go to Tools menu)

Check if you have a problem with your javascript.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 01:49PM

Live PHP Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month