You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Scrollable with 2 rows of items visible Created Mar 11, 2010

This thread is solved

Views: 1621     Replies: 10     Last reply Apr 4, 2010  
You must login first before you can use this feature

fishnyc

Posts: 5

Registered:
Mar 11, 2010

Scrollable with 2 rows of items visible

Posted: Mar 11, 2010

Hey all. I currently have my vertical scrollable set up and working. I have 32 thumbnails with 2 rows of 4 visible on each page. Essentially, I have multiple ul tags building the sets of 8 images. Each ul is a page.

I was wondering if its possible to have just one ul tag with all of my 32 thumbs in there and showing 8 at a time in 2 rows without the need for the added sets. I tried setting SIZE to 8 but that didnt work. Was hoping someone here might have a suggestion.

Thanks again for a fantastic script. I just found it... Its the best one I've used and I've built a lot of these.

Regards,

Fish

Arhu

Posts: 2

Registered:
Mar 11, 2010

» Scrollable with 2 rows of items visible

Posted: Mar 12, 2010

Reply to: Scrollable with 2 rows of items visible, from fishnyc
Maybe like this? Set SIZE to 2.


<div class="scrollable vertical"> 
 
    <ul class="items"> 
 
        <!-- first item -->
        <li>
            4 images 
        </li>
        <!-- second item -->
        <li>
            4 images 
        </li>
        <!-- third item etc. ... -->

    </ul>

</div>

fishnyc

Posts: 5

Registered:
Mar 11, 2010

» » Scrollable with 2 rows of items visible

Posted: Mar 12, 2010

Reply to: » Scrollable with 2 rows of items visible, from Arhu
Thanks for the reply Arhu. I guess thats similar to having multiple UL tags but instead its multiple LI tags. I can just leave it as it is. was just looking to clean up the code a bit. Thanks again for the reply.

Dave

presson83

Posts: 2

Registered:
Mar 20, 2010

» » » Scrollable with 2 rows of items visible

Posted: Mar 20, 2010

Reply to: » » Scrollable with 2 rows of items visible, from fishnyc
Hey Fish,

WOuld you mind showing your code? I'm trying to do this as well but with no luck.. thanks!

fishnyc

Posts: 5

Registered:
Mar 11, 2010

» » » » Scrollable with 2 rows of items visible

Posted: Mar 20, 2010

Reply to: » » » Scrollable with 2 rows of items visible, from presson83
Hey there. I'm away for the week and don't have the code with me, but essentially I just kept it working how I originally had it. Where size is set to 1 and each UL is the part the slides and the LI tags within are the 2 rows of images. such as below: (using brackets instead of < b/c it doesnt display correctly)

[ul]
[li][/li]
[li][/li]
[li][/li]
[li][/li]
[ul]
[/ul]
[li][/li]
[li][/li]
[li][/li]
[li][/li]
[ul]
[/ul]
[li][/li]
[li][/li]
[li][/li]
[li][/li]
[/ul]
[ul]
[li][/li]
[li][/li]
[li][/li]
[li][/li]
[/ul]
Hope this helps.

Fish

jmbatty

Posts: 2

Registered:
Mar 21, 2010

this worked for me

Posted: Mar 21, 2010

Reply to: Scrollable with 2 rows of items visible, from fishnyc
Note: this is for a horizontal double row scrollable, but you get the idea.


<!-- root element for scrollable -->
<div class="scrollable">		
                               
<!-- root element for the items -->
  <div class="items"> 
      <div>
           <ul>
               <li>
					<img src="image1.png" />
               </li>
               <li>
                	<img src="image2.png" />
               </li>
           </ul>
      </div>
      <div>
           <ul>
               <li>
					<img src="image3.png" />
               </li>
               <li>
                	<img src="image4.png" />
               </li>
           </ul>
      </div>
      <div>
           <ul>
               <li>
					<img src="image5.png" />
               </li>
               <li>
                	<img src="image6.png" />
               </li>
           </ul>
 	  </div>								
  </div>
  <!-- end items -->

</div>
<!-- end scrollable-->

hipweb
Because it's your cyberspace face!

Posts: 17

Registered:
Jul 11, 2009

Do this dynamically?

Posted: Apr 3, 2010

Reply to: this worked for me, from jmbatty
I have an array returned from a MySQL query that contains each item for my scrollable, but I'm not sure how to get it to display in a 3x3 grid, where clicking next will scroll over to the next set of 3x3.

Anyone have any thoughts on how I could do this?

fishnyc

Posts: 5

Registered:
Mar 11, 2010

» Do this dynamically?

Posted: Apr 3, 2010

Reply to: Do this dynamically?, from hipweb
Hey Hipweb.

The way I did it was to create a UL tag for each set of 6 (or in your case 9). So, you need to iterate through the array and count so that when you hit 9 you close the UL tag and then open a new one for the next set. There is prob a better way to do this, but this is how my brain thinks of making it work :)

For example.


$setCount = 0;	// counter that keeps track of each set of scrolling lenses
$count = 0;		// counter that keeps track of the lens we are up to in the list
	while($row = mysql_fetch_array($r)){
		$setCount++;	
		$count++;
		if($setCount == 1) {	// each time we start a new set
			echo "<ul class='mySet'>
";	
		} 
//...
// WRITE your LI TAGS HERE...
//...

     if($setCount == 9 && $count < $totalNum) {	
    // if we have reached our 9th item in the set and we aren't at the end of the list...
	echo "</ul>
";
	$setCount = 0;
     } else if($count == $totalNum) {	//  if we've reached the last item in the list...
	echo "</ul>
";
     }

}

hipweb
Because it's your cyberspace face!

Posts: 17

Registered:
Jul 11, 2009

» » Do this dynamically?

Posted: Apr 4, 2010

Reply to: » Do this dynamically?, from fishnyc
Thanks for the super fast response!

How is $totalNum determined?

*EDIT* I suppose $totalNum = count($array); would work?

fishnyc

Posts: 5

Registered:
Mar 11, 2010

» » » Do this dynamically?

Posted: Apr 4, 2010

Reply to: » » Do this dynamically?, from hipweb
Yup that will do it.. for me it was an mysql query...

Hope it works out.

Fish

hipweb
Because it's your cyberspace face!

Posts: 17

Registered:
Jul 11, 2009

Success

Posted: Apr 4, 2010

Reply to: » » » Do this dynamically?, from fishnyc
This worked perfect, thank you!