Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Modal pop-up and images fade-in/out javascript needs tweaking

Posted on 2013-10-31
6
Medium Priority
?
294 Views
Last Modified: 2013-11-08
My page here uses a modal pop up and javascript for the photos.

I can't find where to change the following style applied to the .zmainphotos div:

element.style {
top: 0px;
left: 0px;
display: none;
z-index: 6;
width: 640px;
opacity: 0;
}

Open in new window


Also the main photos fade-in-fade-out doesn't work well - they snap instead of fade, not a good effect.  

Then there's the bleeding at the bottom of the main photos with the next image fading in/out.

Here's the photos javascript:

		

<div class="nav">
<a id="prev1" href="#" style="background: #000 url('/images/arrow_left.png') no-repeat 33% 50%;
position: absolute;
left:0px;
top: 0px;
outline: 0;
width: 35px;
height: 35px;
text-indent: -9999px;
z-index: 500;
padding: 3px;
opacity: 0.45;">Prev</a> 

<div id="pager"></div> 

<a id="next1" href="#" style="right: 0;
background: #000 url('/images/arrow_right.png') no-repeat 63% 50%;
position: absolute;
top: 0px;
outline: 0;
width: 35px;
height: 35px;
text-indent: -9999px;
z-index: 500;
padding: 3px;
opacity: 0.45;
">Next</a></div>
	
        <div class="zmain-photos" id="zmain-photos" style="">
         <% if len(""&rsAdvert("Image1")) > 0 then %>
           <div><img width="100%" alt="In <%=(Session("PublicFranchiseName"))%>" src="/includes/tn.asp?src=<%=server.URLEncode(rsAdvert("Image1"))%>" /></div>
         <% end if %>
         <% if len(""&rsAdvert("Image2")) > 0 then %>
           <div><img width="100%" alt="In <%=(Session("PublicFranchiseName"))%>" src="/includes/tn.asp?src=<%=server.URLEncode(rsAdvert("Image2"))%>" /></div>
         <% end if %>
         <% if len(""&rsAdvert("Image3")) > 0 then %>
           <div><img width="100%" alt="In <%=(Session("PublicFranchiseName"))%>" src="/includes/tn.asp?src=<%=server.URLEncode(rsAdvert("Image3"))%>" /></div>
         <% end if %>
         <% if len(""&rsAdvert("Image4")) > 0 then %>
           <div><img width="100%" alt="In <%=(Session("PublicFranchiseName"))%>" src="/includes/tn.asp?src=<%=server.URLEncode(rsAdvert("Image4"))%>" /></div>
         <% end if %>
         <% if len(""&rsAdvert("Image5")) > 0 then %>
          <div> <img width="100%" alt="In <%=(Session("PublicFranchiseName"))%>" src="/includes/tn.asp?src=<%=server.URLEncode(rsAdvert("Image5"))%>" /></div>
         <% end if %>
         <% if len(""&rsAdvert("Image6")) > 0 then %>
          <div> <img width="100%" alt="In <%=(Session("PublicFranchiseName"))%>" src="/includes/tn.asp?src=<%=server.URLEncode(rsAdvert("Image6"))%>" /></div>
         <% end if %>
      </div>


<!--Start Photo Viewer Jquery Cycle code & Tabs Menu-->
		<script src="/js/jquery.cycle.all.js" type="text/javascript"></script>
		<script type="text/javascript" src="/js/Tabs.js"></script>
		<script type="text/javascript">
			if ($('#zmain-photos').length > 0) {
				$('#zmain-photos').cycle({
					pager: '#pager',
					prev:   '#prev1', 
					next:   '#next1',
				});
			}
		</script>
		<!--End Photo Viewer Jquery Cycle code-->

Open in new window


There's more in the bootstrap.min.js, if you need it I can post it.

Then page jumps down in the background when a thumb's clicked, and the pop up modal needs to scroll down with the page (for smaller screens viewing images).

Any ideas would 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
  • 4
6 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 39616268
I do not see any of that in Chrome or IE8

I do see some syntax errors from the page tracker in IE8
0
 
LVL 43

Expert Comment

by:Rob
ID: 39616351
Firstly the element.style you're seeing is applied at runtime via the jquery cycle plugin:
<!--Start Photo Viewer Jquery Cycle code & Tabs Menu-->
		<script src="/js/jquery.cycle.all.js" type="text/javascript"></script>
		<script type="text/javascript" src="/js/Tabs.js"></script>
		<script type="text/javascript">
			if ($('#zmain-photos').length > 0) {
				$('#zmain-photos').cycle({
					prev:   '#prev1', 
					next:   '#next1',
				});
			}
		</script>
		<!--End Photo Viewer Jquery Cycle code-->

Open in new window


http://www.inside-guides.co.uk/css/FullPageAdvert.css is the css that otherwise applies to the element.
0
 
LVL 43

Expert Comment

by:Rob
ID: 39616355
In terms of tweaking the effect you should have a look at the available options: http://jquery.malsup.com/cycle/options.html
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 43

Expert Comment

by:Rob
ID: 39616370
There is also an extra comma after #next you need to remove

$('#zmain-photos').cycle({
					prev:   '#prev1', 
					next:   '#next1', <-------- remove this comma
				});

Open in new window

0
 
LVL 43

Accepted Solution

by:
Rob earned 2000 total points
ID: 39616371
This is more the transistion you're after?  

http://jsbin.com/irIjos/1/edit
0
 

Author Comment

by:UName10
ID: 39633068
Yes - that's the one. Thanks for the help.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

636 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