/    Sign up×
Community /Pin to ProfileBookmark

popup javascript

here is what im trying to do, I have a box with text in it and I want to have a an onclick event that pop up a window that will allow user to change font style, size and color.
THis website has a perfect example:[URL=”http://www.tinyprints.com/personalize/859401/Growing%20Garden.html#personalize”]http://www.tinyprints.com/personalize/859401/Growing%20Garden.html#personalize[/URL]

I dont want it to be a regular window, instead more like a hidden div that becomes visible next to the textbox that is clicked.

Thanks

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Aug 10.2009 — Show:
[CODE]document.getElementById("foo").style.display="block";
[/CODE]
Hide:
[CODE]document.getElementById("foo").style.display="none";
[/CODE]



The box css
[CODE]
#foo{
position: absolution;
top: 100px;
left: 200px;
border: 1px solid black;
width: 200px;
height: 200px;
background-color: #CCCCCC;
display: none;
}
[/CODE]



Eric
Copy linkTweet thisAlerts:
@Pbear74authorAug 11.2009 — Thanks Eric, that seems to do the job just fine.


However, now I have another issue, I want the popup to display next to the textbox that activated it.


How do i get its location if it is nested within several controls.

i.e.

<body>

<div>

<table>

<tr>

<td>

<input id="name" onclick="showDiv()" />

</td>

</tr>

</table>

</div>

</body>
×

Success!

Help @Pbear74 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 6.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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...