•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 375,168 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,266 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 4368 | Replies: 2
![]() |
•
•
Join Date: Oct 2007
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
Hello,
I am new to javascript and am aware that this topic is well documented, but not in the way I need the script to work?
I am able to show/ hide a div using the the following:
function toggleMe(a){
var e=document.getElementById(a);
if(!e)return true;
if(e.style.display=="none"){
e.style.display="block"
} else {
e.style.display="none"
}
return true;
}
With a link using:
<a href="#" onClick="return toggleMe('flashOverlay')">Info</a>
The problem I have is that I need to toggle this script with a link in Flash MX, which will not allow me to use "onClick=". Is it possible to have the div show/hide via <a href></a> only?
Thanks in advance
I am new to javascript and am aware that this topic is well documented, but not in the way I need the script to work?
I am able to show/ hide a div using the the following:
function toggleMe(a){
var e=document.getElementById(a);
if(!e)return true;
if(e.style.display=="none"){
e.style.display="block"
} else {
e.style.display="none"
}
return true;
}
With a link using:
<a href="#" onClick="return toggleMe('flashOverlay')">Info</a>
The problem I have is that I need to toggle this script with a link in Flash MX, which will not allow me to use "onClick=". Is it possible to have the div show/hide via <a href></a> only?
Thanks in advance
•
•
Join Date: Oct 2007
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
I got it working using the following:
function showHide() {
for (var i=0; i<expandCollapse.arguments.length; i++) {
var element = document.getElementById(expandCollapse.arguments[i]);
element.style.display = (element.style.display == "none") ? "block" : "none";
}
}
<a href="javascript: showHide('flashOverlay')">Search site</a>
function showHide() {
for (var i=0; i<expandCollapse.arguments.length; i++) {
var element = document.getElementById(expandCollapse.arguments[i]);
element.style.display = (element.style.display == "none") ? "block" : "none";
}
}
<a href="javascript: showHide('flashOverlay')">Search site</a>
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
- Slide In, Slide Out, ala Digg (JavaScript / DHTML / AJAX)
- Getting the height and width of content fitting DIV element. (JavaScript / DHTML / AJAX)
- CSS Div's For Myspace (HTML and CSS)
- Hover Image Position ??? (HTML and CSS)
- offsetTop prob - need to determine if a div is visible (HTML and CSS)
- DIV Help! (HTML and CSS)
- update the page without changing it? (Site Layout and Usability)
- Hide all DIV's On Click (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Image marquee thumbnails?
- Next Thread: why won't my print button work



Linear Mode