Jump to content

Empty Space On Horizontal Scroll


chwebdesigns

Recommended Posts

Hi,

 

I have no idea why this problem is happening, so was wondering if anyone could help?

 

I have a PHP script pulling images from a flickr account and displaying them on my website. The images are set so that they appear in a horizontal scroll box which fills the width of the page content.

 

However, when the page is first loaded, there is a load of blank space at the end of the scroll box, making the scroll box continue, on the page refresh/reload this blank space disappears and the total width of the scroll box is just that so all of the images fit in.

 

I hope this makes sense? Any ideas?

 

The relevant parts of the CSS coding are as follows:

 

#streamcontainer {white-space: nowrap;height: 360px;}#photostream {width: 670px;height: 365px;overflow-x: auto;overflow-y: hidden;white-space: nowrap;}

 

I have also included below the relevant HTML and PHP Coding incase this helps at all?

 

<div id="photostream">  <div id="streamcontainer">		 <?php		  $flickr = getSet($theSet);		 ?>  </div></div>

 

<?php
function getSet($which) {global $user;global $apikey;$method = 'flickr.photosets.getPhotos';$params['user_id'] = $user;$photoCollection =& new DOMIT_Document();	    $request_url = 'http://www.flickr.com/services/rest/?';			    if (empty($params)) $params = array();$params['api_key'] = $apikey;$params['method'] = $method;$params['photoset_id'] = $which;	    foreach ($params as $var => $val) {				 $var = urlencode($var);				 $val = urlencode($val);				 $request_url .= "&$var=$val";	    }$safe_return = getFileContents($request_url);$response = $photoCollection->parseXML($safe_return);$photos =& $photoCollection->documentElement->getElementsByTagName("photo");$total = $photos->getLength();  for ($i=0; $i<$total; $i++) {	    $currImg =& $photos->item($i);  $id =& $currImg->getAttributeNS($URI, 'id');  $server =& $currImg->getAttributeNS($URI, 'server');  $secret =& $currImg->getAttributeNS($URI, 'secret');  echo "<a href=\"http://static.flickr.com/".$server."/".$id."_".$secret.".jpg\" rel=\"lightbox[flickr]\" title=\"".$id."\" name=\"$user\"><img src=\"http://static.flickr.com/".$server."/".$id."_".$secret.".jpg\"  alt=\"Catherine Laura Photography\" class=\"photo\" /></a>";}}
?>

 

Any help or ideas are much appreciated - as I am absolutley stumped on thoughts now!

 

Many thanks in advance,

Cal

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.