PDA

View Full Version : enhancing image navigation


satra
09-19-2005, 09:21 PM
I've made a small change to the image_template.html file in pepper_revisted but should apply to all templates. This allows navigation by clicking on the image. Clicking on the left half of the imagegoes back one image, while clicking on the right half goes forward one image.


<div style="text-align:center">
<map name="lrmap">
<script type="text/javascript">
var middle1 = <IMAGE_WIDTH>/2;
var middle2 = middle1+1;
document.write("<area shape=\"rect\" alt=\"previous photo\" title=\"previous photo\" coords=\"0\
,0,"+middle1+",<IMAGE_HEIGHT>\" href=\"index.php?showimage=<IMAGE_PREVIOUS_ID>\" />");
document.write("<area shape=\"rect\" alt=\"next photo\" title=\"next photo\" coords=\""+middle2\
+",0,<IMAGE_WIDTH>,<IMAGE_HEIGHT>\" href=\"index.php?showimage=<IMAGE_NEXT_ID>\" />");
</script>
</map>
<!-- <a href="index.php?showimage=<IMAGE_PREVIOUS_ID>"> -->
<img id="image" src="images/<IMAGE_NAME>" alt="<IMAGE_TITLE>" title="previous image: <IMAGE_PREVIO\
US_TITLE>" usemap="#lrmap"/>
<!-- </a> -->
</div>

ctranter
09-19-2005, 10:19 PM
nice one

brian connolly
09-19-2005, 11:21 PM
and with all due respect, how would a user know that?

premii
09-19-2005, 11:58 PM
I have next/prev navigation like this but instead of area i am using CSS for W3c standard browser and javascript/css for IE.

http://foto.premii.com

Joe[y]
09-20-2005, 06:37 AM
this is a good idea! a further help to us minamalists!

Joe[y]
09-20-2005, 04:29 PM
this is just plain not working:

<div style="text-align:center">
<map name="lrmap">
<script type="text/javascript">
var middle1 = <IMAGE_WIDTH>/2;
var middle2 = middle1+1;
document.write("<area shape=\"rect\" alt=\"previous photo\" title=\"previous photo\" coords=\"0\
,0,"+middle1+",<IMAGE_HEIGHT>\" href=\"<IMAGE_PREVIOUS_ID>\" />");
document.write("<area shape=\"rect\" alt=\"next photo\" title=\"next photo\" coords=\""+middle2\
+",0,<IMAGE_WIDTH>,<IMAGE_HEIGHT>\" href=\"<IMAGE_NEXT_ID>\" />");
</script>
</map>

<!-- <a href="<IMAGE_PREVIOUS_ID>"> -->
<img src="/images/<IMAGE_NAME>" alt="<IMAGE_TITLE>" title="<IMAGE_TITLE>" width="<IMAGE_WIDTH>" height="<IMAGE_HEIGHT>" id="photo" usemap="#lrmap" />
<!-- </a> -->
</div>

Joe[y]
09-21-2005, 02:22 PM
any help with it would be appreciated because i can't understand why - i don't understand JS that well.

nikynik
09-22-2005, 10:27 AM
The first solution is this but you have to put manually the half width of image for work correctly

<!-- <a href="index.php?showimage=<IMAGE_PREVIOUS_ID>"> -->
<img src="images/<IMAGE_NAME>" alt="<IMAGE_TITLE>" title="<IMAGE_TITLE>" width="<IMAGE_WIDTH>" id="photo" usemap="#imgmap"/>
<!-- </a> -->
<map id="imgmap" name="imgmap">
<area name="prev" shape="rect" coords="0,0,put here the half size of yor image,<IMAGE_HEIGHT>" href="index.php?showimage=<IMAGE_PREVIOUS_ID>"/>
<area name="next" shape="rect" coords="put here the half size of yor image,0,<IMAGE_WIDTH>,<IMAGE_HEIGHT>" href="index.php?showimage=<IMAGE_NEXT_ID>"/>
</map>

If there are some expert to replace automatically the half width of image?

Joe[y]
09-25-2005, 04:38 PM
yes that worked. but i have different image widths so that's not perfect by far!

is there a way anybody can think of to do this through css?

blinking8s
09-26-2005, 05:09 AM
in my prepress template it pulls the image height and width to position the registration marks...i assume that meathod could be used to do this

premii
09-26-2005, 02:55 PM
Yes you can make CSS only navigation, but it wont work perfectly in IE.
You can use javascript for IE, and css for Mozilla.

heres example http://foto.premii.com


']yes that worked. but i have different image widths so that's not perfect by far!

is there a way anybody can think of to do this through css?

satra
10-23-2005, 02:25 AM
and with all due respect, how would a user know that?
I have the navigation howto in my info page. Not directly obvious, but for those who do read the information page, they would know!

satra
10-23-2005, 02:31 AM
I have next/prev navigation like this but instead of area i am using CSS for W3c standard browser and javascript/css for IE.

http://foto.premii.com
nice design! I like the arrows. The idea for my navigation was taken from www.slower.net one of the very first foto blogs that I really liked.

Marek
11-13-2006, 10:20 AM
Hello,

Iīm using the template jasonspix (http://www.pixelpost.org/v1/index.php?x=downloads&details=117) and I want to integrate the navigation arrows which can were in the original ame235 theme (http://www.pixelpost.org/v1/index.php?x=downloads&details=178). Can anyone just "extract" the code for the arrows and tell me how I can use them in the jasonspix theme?

Marek

Marek
11-14-2006, 08:32 AM
Hello,

Iīve got the code, but the navigation arrows are on the left side not centered above the image. Whatīs wrong with it?
Can someone help me?

kidleethal
11-14-2006, 11:54 AM
Hi,

I pulled the code for the image navigation out of the 235 template for use in my custom template, and it works fine in all browsers (even IE...except for the PNG transparency).

If anyone is looking to implement this function into their site, I would recommend doing it that way. He's optimised the code well, and it's entirely CSS driven.

Just make sure you give credit to ame235 :)

Lee


<-- righteous photo flavours ---
http://www.decoy.co.nz

Marek
11-14-2006, 05:20 PM
Hi,

I pulled the code for the image navigation out of the 235 template for use in my custom template, and it works fine in all browsers (even IE...except for the PNG transparency).

http://www.decoy.co.nz

I was sure that Iīm doing the same. I donīt know what I doing wrong.

Ok. here a part of the css
.stretcher {
background: none !important;
background: #fff;
}
#content {
background: url(footer.gif) bottom center no-repeat;
padding: 0 0 20px 0;
}
#image {
padding: 0px;
position: relative;
background-color: #fff;
width: 250px;
height: 250px;
margin: 0 auto;
}
#imgmaine {
background: #efefef url('loading.gif') 50% 50% no-repeat;
}
#menu_browse{
position: absolute;
top: 0px;
left: 0px;
z-index: 10;
}
#menu_browse a{ outline: none;}
#menu_browse_prev, #menu_browse_next{
width: 49%;
height: 99%;
background: transparent url(blank.gif) no-repeat; /* Trick IE into showing hover */
display: block;
}
#menu_browse_prev {
left: 0;
float: left;
}
#menu_browse_next {
right: 0;
float: right;
}
#menu_browse_prev:hover, #menu_browse_prev:visited:hover {
background: url('prev.gif') no-repeat left 45%;
cursor: pointer;
}
#menu_browse_next:hover, #menu_browse_next:visited:hover {
background: url('next.gif') no-repeat right 45%;
cursor: pointer;
}

and here the html part
<div id="content">
<div id="image">
<img src="./images/<IMAGE_NAME>" id="imgmaine" width="<IMAGE_WIDTH>" height="<IMAGE_HEIGHT>" />
<div id="menu_browse" style="height: <IMAGE_HEIGHT>px; width: <IMAGE_WIDTH>px;">
<a href="#" id="menu_browse_prev" onclick="document.location = 'index.php?showimage=<IMAGE_PREVIOUS_ID>';"></a>
<a href="#" id="menu_browse_next" onclick="document.location = 'index.php?showimage=<IMAGE_NEXT_ID>';"></a>
</div>
</div>
</div>

Iīve got a beta here (http://beta.mareknierychlo.de).(only at the darkgrey style) I donīt understand why the image not centered.and the things which have to be below the image are not where they have to be.

Marek

kidleethal
11-15-2006, 10:19 AM
Your problems have nothing to do with the image navigation code. That's working fine.

I had a quick look at your CSS. I think your main problem is that you've given dimensions to the div's for the image and the footer (250px by 250px for #image, and 528px for the footer). There is no need to do this - the image will take up however many pixels it needs to, just let it do it's thing. If you give it no dimensions and set the margins to 0 for top and bottom and 'Auto' for left and right, then the div will position in the centre of the page.

Also, the #image div has relative positioning inside the #content div.

Lee


<-- righteous photo flavours ---
http://www.decoy.co.nz

Marek
11-16-2006, 04:28 AM
Do you mean something like this?
#image {
padding: 0px;
position: relative;
background-color: #333333;
margin-bottom:0;
margin-top:0;
margin-right:auto;
margin-left:auto;
}
it doesnīt work -> look here (http://beta.mareknierychlo.de/templates/jasonspix/style.css) for full css
the image and the navigation are now on the left side and not centered.

Here it is-> beta (http://beta.mareknierychlo.de)

kidleethal
11-16-2006, 05:12 AM
I can't log onto your site at the moment, but I ripped all the CSS off it the other night.

Try removing the relative positioning from your #image div, and see what happens.

Marek
11-16-2006, 05:30 AM
No, it doesnīt work. It is still on the left side.

maybe my site works now-> http://beta.mareknierychlo.de

edit:...and it still doesnīt work. the navigation arrows arenīt at 50% of the height of the image. So Iīve got 2 errors.

1. The navigation and the image are on the left side, but they have to be centered.
2. the navigation arrows arenīt 50% of the image. They are higher and I donīt know why.

edit2:
Iīve got two screenshots. my cssedit shows me that the div#image covers the image but it is on the left side(screenshot on flickr (http://static.flickr.com/103/298653217_822304203b_o.png)) and the div#menu_browse is too high. (screenshot 2 (http://static.flickr.com/115/298655136_9d2206fe51.jpg)).

edit3: my site got technical difficulties (ddos) so, I will show you the code here.

<body>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>

<!-- Bar across the top -->
<div class="topbar">
<span class="style1">
<IMAGE_PREVIOUS_LINK> &nbsp;??&nbsp;
<a href="index.php" title="cssbody=[tooltipbdyfoto] cssheader=[tooltiphdrfoto] header=[Aktuelles Bild] body=[Nach dem Klick gelangst Du zum aktuellen Bild]">Aktuell</a>&nbsp;??&nbsp;
<IMAGE_NEXT_LINK>&nbsp;??&nbsp;
<a href="index.php?x=browse" title="cssbody=[tooltipbdyfoto] cssheader=[tooltiphdrfoto] header=[Archiv] body=[Alle Bilder des Fotoblogs auf einer Seite!]" >Thumbs</a>&nbsp;??&nbsp;
<a href="index.php?x=about" title="cssbody=[tooltipbdyfoto] cssheader=[tooltiphdrfoto] header=[About page] body=[ein paar Worte &uuml;ber mich]" >About + Links</a>&nbsp;??&nbsp;
<a href="index.php?x=jbgmap" title="cssbody=[tooltipbdyfoto] cssheader=[tooltiphdrfoto] header=[Aufnahmeort] body=[Nach dem Klick erscheinen die Aufnahmeorte auf einer googlemaps-Karte]" onmouseout="return nd();">Map</a>&nbsp;??&nbsp;
<a href="index.php?popup=comment&amp;showimage=<IMAGE_ID>" title="cssbody=[tooltipbdyfoto] cssheader=[tooltiphdrfoto] header=[Kommentare und Infos] body=[wie der Titel schon sagt, Kommentare und EXIF-Daten zu dem Bild]" onclick="window.open(this.href, 'Comments','height=550, width=500, top=10, left=10, toolbar=no, menubar=no, location=no, resizable=no, scrollbars=yes, status=no'); return false;" ><IMAGE_COMMENTS_NUMBER> Comments & Info</a> &nbsp;??&nbsp;

<a href="index.php?x=rss" title="cssbody=[tooltipbdyfoto] cssheader=[tooltiphdrfoto] header=[RSS-Feed] body=[klick f&uuml;r ein Abo]" >RSS</a>&nbsp;??&nbsp;
<a href="#" onclick="setActiveStyleSheet('white');return false;"><img class="i1" border="1" src="templates/jasonspix/style_White.jpg" width="9" height="9" style="padding:0;" align="middle" alt="whiteswitch"/></a>
<a href="#" onclick="setActiveStyleSheet('lightgrey');return false;"><img class="i1" border="1" src="templates/jasonspix/style_Grey.jpg" width="9" height="9" style="padding:0;" align="middle" alt="lightgreyswitch"/></a>
<a href="#" onclick="setActiveStyleSheet('darkgrey');return false;"><img class="i1" border="1" src="templates/jasonspix/style_DGrey.jpg" width="9" height="9" style="padding:0;" align="middle" alt="darkgreyswitch"/></a>
<a href="#" onclick="setActiveStyleSheet('black');return false;"><img class="i1" border="1" src="templates/jasonspix/style_Black.jpg" width="9" height="9" style="padding:0;" align="middle" alt="blackswitch"/></a>
</span>
</div>

<!-- Bar above Image -->
<div align="center">
<div style="width: <IMAGE_WIDTH>px;">
<div id="aboveImage">
<div class="ititle">
<strong>
<IMAGE_TITLE>&nbsp;??&nbsp;
</strong>
</div>
<div class="nav">

<a href="index.php?popup=comment&amp;showimage=<IMAGE_ID>" title="cssbody=[tooltipbdyfoto] cssheader=[tooltiphdrfoto] header=[Kommentare und Infos] body=[wie der Titel schon sagt, Kommentare und EXIF-Daten zu dem Bild]" onclick="window.open(this.href, 'Comments','height=550, width=500, top=10, left=10, toolbar=no, menubar=no, location=no, resizable=no, scrollbars=yes, status=no'); return false;" ><IMAGE_COMMENTS_NUMBER> Comments &amp; Info</a> &nbsp;??&nbsp;
</div>
</div>
</div>
</div>
<!-- Blog Image -->

<div id="content">
<div id="image" style="width: <IMAGE_WIDTH>px;">
<img src="./images/<IMAGE_NAME>" id="imgmaine" width="<IMAGE_WIDTH>" height="<IMAGE_HEIGHT>" alt="foto fehlt" />
<div id="menu_browse" style="height: <IMAGE_HEIGHT>px; width: <IMAGE_WIDTH>px;">
<a href="#" id="menu_browse_prev" onclick="document.location = 'index.php?showimage=<IMAGE_PREVIOUS_ID>';"></a>
<a href="#" id="menu_browse_next" onclick="document.location = 'index.php?showimage=<IMAGE_NEXT_ID>';"></a>
</div>
</div>
</div>
<!-- Bar below Image -->
<div style="width: <IMAGE_WIDTH>px;">
<div id="belowImage">
<div class= "blogLink">
<p><JBG_PICTOMAP></p>
Đ All images Marek Nierychlo
</div>
</div>
</div>
</body>
</html>
and css
body {
background-color: #333333;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
#AboveImage {
text-align:left;
padding: 0px;
margin-top: 2em;
}
.ititle {
float:left;
position:relative;
text-align:right;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #ffffff;
}
.ititle a:visited {
color: #ffffff;
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.ititle a:hover {
color: #666666;
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.nav{
text-align:right;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #ffffff;
}
.nav a:visited {
color: #ffffff;
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.nav a:hover {
color: #666666;
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
#belowImage {
padding: 0px;
margin-bottom: 0px;
}
.blogLink {
float:right;
position:relative;
text-align:right;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #ffffff;
}
.blogLink a:visited {
color: #ffffff;
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.blogLink a:hover {
color: #666666;
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.commentLink {
text-align:left;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.commentLink a:visited {
color: #ffffff;
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.commentLink a:hover {
color: #666666;
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
a:link {
color: #ffffff;
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
a:visited {
color: #ffffff;
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
a:hover {
color: #999999;
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.thumbnails {
padding:2px;
background:#000000;
border:1px solid #A1A2AA;
margin:5px;
}
#thumbmain a:hover img{
border:1px solid #ffffff;
}
.image {
text-align:center;
margin-top:0em;
padding:5px;
background:#000000;
border:none;

}
.style1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
text-decoration: none;
}
.topbar a:link, a:visited, a:active {
color: #000000;
text-decoration: none;
}
.topbar a:hover {
color: #999999;
text-decoration: none;
}
.topbar {
text-align: center;
background:#CCCCCC;
margin-bottom: 10px;
height: 20px;
border:1px solid #ffffff;
}
#blogimage {
margin-top: 0em;
text-align:center;
color: #ffffff;
}
#commentBlock {
text-align:left; width: 450px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #ffffff;
}
#commentBlock a {
color: #666666;
}
#commentBlock a:visited {
color: #666666;
}
#commentBlock a:hover {
color: #000000;
}
#commentMain {
width:100%;
}
#commentMain ul {
padding:0px; margin:0px; display:block; list-style:none; width:100%;
}
#commentMain li {
padding-bottom:10px; padding-top:10px; padding-left:5px; padding-right:0px; margin:0px; border-top:0px;
border-left:0px; border-right:0px; border-bottom:1px solid #ffffff;
}
#commentMain li:hover {
background:#000066;
}
#commentMain li a {
color: #666666;
}
<!--js tooltip -->
shortening css,itīs too long
<!--image navigation -->
.stretcher {
background: none !important;
background: #fff;
}
#content {
margin:0;
background: bottom center no-repeat;
padding: 0 0 20px 0;
}
#image {
padding: 0px;
}
#imgmaine {
background: #efefef url('loading.gif') 50% 50% no-repeat;
}
#menu_browse{
position: absolute;
top: 0px;
left: 0px;
z-index: 10;
}
#menu_browse a{ outline: none;}
#menu_browse_prev, #menu_browse_next{
width: 49%;
height: 99%;
background: transparent url(blank.gif) no-repeat; /* Trick IE into showing hover */
display: block;
}
#menu_browse_prev {
left: 0;
float: left;
}
#menu_browse_next {
right: 0;
float: right;
}
#menu_browse_prev:hover, #menu_browse_prev:visited:hover {
background: url('prev.gif') no-repeat left 45%;
cursor: pointer;
}
#menu_browse_next:hover, #menu_browse_next:visited:hover {
background: url('next.gif') no-repeat right 45%;
cursor: pointer;
}



again the question: Whatīs wrong?
marek

kidleethal
11-16-2006, 09:36 PM
It's difficult for me to see the cause of the problem without being able to edit with the code and see it's effects.

My suggestion is, that since you have two problems, seperate them out so you don't get confused:

For the time being, remove the image navigation code entirely, and just concentrate on getting your main image centred. When that's done, reintroduce the image navigation code and see if that's whats your causing the problems.

Otherwise, if you try to fix both problems at once you're just going to get confused.

You could also try emailing the creator of the navigation code.

Marek
11-20-2006, 01:07 PM
i tried to modify the code sometimes, itīs strange. it works good with the original jasonspix css, but when I change it a little bit with the navi code the photoblog gets buggy. Maybe I got nervs in the next few days...

luckyfinger
12-01-2006, 04:20 PM
....

Tommy
12-26-2006, 10:11 AM
Gaaah, I copied this menu_browse thing from 235 skin into my custom skin and well it works, but it isn't positioned correctly. #menu_browse is absolutely in the top left of my site not above the image. And I can't understand, how it could possibly be somewhere else than in the top left corner, if its absolute position is top:0 and left:0. Yet in other sites the #menu_browse is correctly above image, although those sites have absolute position top:0 and left:0, too.

GeoS
12-26-2006, 10:23 AM
It means that layer conaitining this one have over properties.

Tommy
12-26-2006, 01:05 PM
OK, found the solution. I put position:relative to the "upper" div, that contains <div id=menu_browse> and it works now. Now the #menu_browser is positioned absolutely in the upper div, not absolutely on the whole page.

xxivxxv
05-16-2007, 03:23 AM
i'm trying to implament this on my own photoblog: www.xxivxxv.com and am having problems. i feel like i've placed the code correctly, but i don't see anything happening. would someone help bail me out here? thanks.