Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Template design and Front-End Code

Post Reply
 
Thread Tools
  #1  
Old 05-31-2005, 02:30 PM
steff Offline
pixelpost guru
 
Join Date: Feb 2005
Location: Milan, Italy
Posts: 151
Send a message via MSN to steff
function flip(rid)

hi, in non-popup templates there's this function, which scrolls the page to show the add-comment area.
I modified my template to hide comments as well, as you can see:

http://steff.altervista.org/

but, how can I make the page scroll downwards? now the image is pushed upwards and disappears from screen; I would like the bottom div to scroll downward instead

hope someone can help!
Reply With Quote
  #2  
Old 05-31-2005, 02:37 PM
Joe[y]'s Avatar
Joe[y]+ Offline
Team Pixelpost
 
Join Date: Mar 2005
Location: UK
Posts: 3,101
Send a message via MSN to Joe[y]
nothing is really scrolling up or down. all that is happening is you are revealing a section of code and then instructing the page to focus on <a name="addcomment"> through using the hyperling #addcomment.

however... if you don't want this link to focus straight on to the addcomment box then you just need to move the <a name="addcomment"> to a new location... wherever you move this tag is where the top of the screen will be when you click on the addcomment link.
Reply With Quote
  #3  
Old 05-31-2005, 02:41 PM
Connie
Guest
 
Posts: n/a
Steff,

have a look:

there is an id [i]comments[i]:
Code:
<div id="comments">
<a href='#' onclick="flip('add-comment'); return false;">Add Comment</a><p />
when you click on the link, the click returns the parameter 'add-comment' to the function 'flip', which will parse the document for the id 'add-comment'
the text which is invisible first and will be visible after the click sits inside this
<div id="add-comment">, so this part will be made visible

in your comment-template, enclose your form into this div and close this div before the bottom of the page... and the function should find it
Reply With Quote
  #4  
Old 05-31-2005, 03:21 PM
steff Offline
pixelpost guru
 
Join Date: Feb 2005
Location: Milan, Italy
Posts: 151
Send a message via MSN to steff
thank you both!
I tried but unfortunately it didn't work: i moved the <a name="addcomment"> to the top of the image, but got no results...

my code is:

Code:
<div id="image-info">

(snip)

Posted on: <IMAGE_DATETIME> --- <b><a href='#addcomment' onclick="flip('comments'); gotocomments(); return false;"><IMAGE_COMMENTS_NUMBER> comments (add)</a></b> --- <a href="?showimage=<IMAGE_ID>">Permalink</a> --- <IMAGE_CATEGORY><br />

</div>

<div id="comments">
 <script type='text/javascript'>
 <!--
 function gotocomments()
 {
	document.location = '#comments';
 }
 -->
 </script>

Please <b>Add a Comment</b> to this image! <img src="smileys/icon_razz.gif" border="0"> Comments and critiques are welcome<br />

<IMAGE_COMMENTS>

<script language='javascript' type='text/javascript'>flip('comments');</script>

<a name="addcomment">

<form method='post' action='index.php?x=save_comment' name='commentform' accept-charset='UTF-8'></a>
Message:<br />

(snip)
I joined the 2 originaty DIVs of the light template: add-comment and comments, and used just one DIV to simplify my task...

what's wrong?
Reply With Quote
  #5  
Old 05-31-2005, 03:27 PM
Connie
Guest
 
Posts: n/a
you have this javascript in your header:

Code:
<script language='javascript' type='text/javascript'>
<!-- BEGIN
function flip(rid)
{
    current=(document.getElementById(rid).style.display == 'none') ? 'block' : 'none';
    document.getElementById(rid).style.display = current;
}
// End -->
</script>
?
Reply With Quote
  #6  
Old 05-31-2005, 03:31 PM
steff Offline
pixelpost guru
 
Join Date: Feb 2005
Location: Milan, Italy
Posts: 151
Send a message via MSN to steff
yes of course I have
Reply With Quote
  #7  
Old 05-31-2005, 05:20 PM
Joe[y]'s Avatar
Joe[y]+ Offline
Team Pixelpost
 
Join Date: Mar 2005
Location: UK
Posts: 3,101
Send a message via MSN to Joe[y]
i'm looking at your source right now....


<a name="addcomment"> is in it's original position still. :?
Reply With Quote
  #8  
Old 05-31-2005, 10:06 PM
steff Offline
pixelpost guru
 
Join Date: Feb 2005
Location: Milan, Italy
Posts: 151
Send a message via MSN to steff
yes I undid my changes
Reply With Quote
  #9  
Old 06-03-2005, 12:48 PM
steff Offline
pixelpost guru
 
Join Date: Feb 2005
Location: Milan, Italy
Posts: 151
Send a message via MSN to steff
I did it!
I remove the gotocomments() function and now it works
thanks to http://www.nauglevision.com/pix/index.php?showimage=319 where I copied the idea from ops:
Reply With Quote
  #10  
Old 06-05-2005, 11:52 AM
doffer Offline
pixelpost guru
 
Join Date: Mar 2005
Location: Oslo
Posts: 159
Fun... I wanted to do my comments in a bit different way, and endened up pretty much the same as described in this thread... If you guys take a look at it and tell me what you think, it would be great..
__________________
o b s c u r e
My photoblog, proudly presented and powered by Pixelpost 1.4
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 12:12 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs