/    Sign up×
Community /Pin to ProfileBookmark

popup problems

alright, i’ve just about got this thing working.
i’ve got two problems.
1. once the popup is up, i would like it to stay in front (not necessarily in focus).
2. when a link is clicked to open the popup, i would prefer the page containing the link to reload.

i know that problem #1 is a big problem, and i’ve yet to see a function witten by anyone that does exactly what i need… and i can’t seem to write a decent one myself.

for problem #2, if you needed to scroll to the bottom of the page to view the image (it’s an image link), once the link gets clicked the page reloads and you would have to scroll back down to click the next image.

here is my page.
[url]http://www.rusmannx.com/sitefiles/rus_runner.htm[/url]

and this is the code i’m using for the link.

[CODE]<a href=”#” onclick=”javascript:window.open(‘../siteimg/rus_runner/stock1.jpg’, ‘newwindow’, ‘width=660, height=500, toolbar=no, scrollbars=no, status=yes, resizable=no, menubar=no’);”>
<img src=”../siteimg/rus_runner/th_stock1.jpg”></a>[/CODE]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@CrazyMerlinSep 03.2006 — well the problem for the second point is this:

say your image was called myImage, you could use:
<i>
</i>document.getElementById('myImage').scrollIntoView();


and that would force the image into view, BUT...what about first time to the page?

you would need something to set globally so that the browser knows this is not the first visit to this page, and that the page was actually reloaded.

you could use a cookie, but that is an issue is their browser doesn't allow them.

as for the first problem, I have seen nothing that truly works to this nature either, yet.
Copy linkTweet thisAlerts:
@Mr_JSep 03.2006 — For #1 why would you want the popup in front yet not focused?

For #2 you could try the query string like this

[code=php]<HTML>
<HEAD>
<TITLE>Document Title</TITLE>

<script>

function chk(){
if (location.search.length > 0){
id = unescape(location.search.substring(1))
offset=document.body.clientHeight/2
goPosition=document.getElementById(id).offsetTop-offset
window.scrollTo(0,goPosition)
}

}

</script>

</HEAD>
<BODY onload="chk()">

<a id="lnk1" href="openpops.htm?lnk1">Link 1<img src=""></a>
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<a id="lnk2" href="openpops.htm?lnk2">Link 2<img src=""></a>
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<a id="lnk3" href="openpops.htm?lnk3">Link 3<img src=""></a>
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<a id="lnk4" href="openpops.htm?lnk4">Link 4<img src=""></a>
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<a id="lnk5" href="openpops.htm?lnk5">Link 5<img src=""></a>
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<a id="lnk6" href="openpops.htm?lnk6">Link 6<img src=""></a>
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
</BODY>
</HTML>[/code]
×

Success!

Help @getret spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...