Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Vertcally align images by removing javascript carousel

Posted on 2013-01-08
2
170 Views
Last Modified: 2013-05-15
My page here uses javascript for the left-nav images, but I want to separate them out by removing javascript so they're vertically listed instead.

Here's the html:
	<% ' images
		if len(""&rsAdvert("Image1"))>0 then addtoarray images,rsAdvert("Image1")
		if len(""&rsAdvert("Image2"))>0 then addtoarray images,rsAdvert("Image2")
		if len(""&rsAdvert("Image3"))>0 then addtoarray images,rsAdvert("Image3")
		if len(""&rsAdvert("Image4"))>0 then addtoarray images,rsAdvert("Image4")
		if len(""&rsAdvert("Image5"))>0 then addtoarray images,rsAdvert("Image5")
		if len(""&rsAdvert("Image6"))>0 then addtoarray images,rsAdvert("Image6")
		
		if isarray(images) then %>
    	<div class="bg">
            <div id="main-photos">
            	<% for i = 0 to ubound(images) %>
                <img alt="<%=(Session("PublicFranchiseName"))%> Business Images" src="/includes/tn.asp?src=<%=server.URLEncode(images(i))%>&amp;" style="<% if i>0 then response.write "display:none;" %>" id="MainImage<%=i%>" class="MainImage" />
                <% next %>
            </div>
        	<div id="photos-preview">
            	<input class="photos-btn" type="button" onclick="slidePrev();" value="»" />
            	<% for i = 0 to ubound(images)
				%><img alt="Small <%=(Session("PublicFranchiseName"))%> Business Images" src="/includes/tn.asp?src=<%=server.URLEncode(images(i))%>&amp;w=30" style="margin:3px;cursor:pointer" onclick="$('.MainImage').fadeOut(500).hide(0,function(){$('#MainImage<%=images(i)%>').fadeIn(500)});" /><%
				next %>
                <input class="photos-btn" type="button" onclick="slideNext();" value="»" />
            </div>
        </div>
        <script type="text/javascript">
			var SlideActive = 0;
			var SlideMax = <%=ubound(images)%>;
			
			function slidePrev() {
				SlideActive -=1;
				if(SlideActive<0){SlideActive=SlideMax;}
				$('.MainImage:not(#MainImage'+SlideActive+')').fadeOut(500);
				$('#MainImage'+SlideActive).delay(500).fadeIn(500);
			}
			
			function slideNext() {
				SlideActive +=1;
				if(SlideActive>SlideMax){SlideActive=0;}
				$('.MainImage:not(#MainImage'+SlideActive+')').fadeOut(500);
				$('#MainImage'+SlideActive).delay(500).fadeIn(500);
			}
			
			$(function(){
				setInterval("slideNext()",5000);
			});
		</script>
    	<% end if %>

Open in new window


If anyone could help that'd be great.
0
Comment
Question by:UName10
2 Comments
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 330 total points
ID: 38758581
Can't you just change the css to display block?

#photos-preview img {
      max-height:22px;
      min-height:22px;
      max-width:30px;
      min-width:30px;
      display: block;
}
0
 

Author Comment

by:UName10
ID: 38814016
Hi there,

Thanks for the reply and sorry for the delay - yep I'll try that.  I want to also add it to a new javascript slider as this fadeout one skips sometimes and looks bad.

There's another question open for that so I'll see what's suggested; ideally I need to separate out the images from the current javascript entirely I think..

I'll come back soon and see how I get on.

Many thanks again.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Html Table looping 4 25
Do alert on select 6 13
Visual Studio npm 1 11
formvalidation.io validate form on class click 4 14
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question