Solved

Vertcally align images by removing javascript carousel

Posted on 2013-01-08
2
174 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
[X]
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
2 Comments
 
LVL 53

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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

688 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