|
#1
|
|||
|
|||
|
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!
|
|
#2
|
||||
|
||||
|
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.
__________________
Affordable Website Design in North Wales |
|
#3
|
|||
|
|||
|
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 />
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 |
|
#4
|
|||
|
|||
|
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)
what's wrong?
|
|
#5
|
|||
|
|||
|
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>
|
|
#6
|
|||
|
|||
|
yes of course I have
|
|
#7
|
||||
|
||||
|
i'm looking at your source right now....
<a name="addcomment"> is in it's original position still. :?
__________________
Affordable Website Design in North Wales |
|
#8
|
|||
|
|||
|
yes I undid my changes
|
|
#9
|
|||
|
|||
|
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:
|
|
#10
|
|||
|
|||
|
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..
|
| Post Reply |
| Thread Tools | |
|
|