UName10
asked on
Modal pop-up and images fade-in/out javascript needs tweaking
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:
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:
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
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;
}
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-->
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
Firstly the element.style you're seeing is applied at runtime via the jquery cycle plugin:
http://www.inside-guides.co.uk/css/FullPageAdvert.css is the css that otherwise applies to the element.
<!--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-->
http://www.inside-guides.co.uk/css/FullPageAdvert.css is the css that otherwise applies to the element.
In terms of tweaking the effect you should have a look at the available options: http://jquery.malsup.com/cycle/options.html
There is also an extra comma after #next you need to remove
$('#zmain-photos').cycle({
prev: '#prev1',
next: '#next1', <-------- remove this comma
});
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes - that's the one. Thanks for the help.
I do see some syntax errors from the page tracker in IE8