|
|
#1 |
|
Simple DOM Scripting question. (need help)
As you may know, there's a flickr script that adds the latest few flickr images to your website. The problem with it is that when you click on an image, it doesn't open it in a new window. I have javascript code that pops up links into new windows if it has a
Code:
class="pop" Here is what I have, but it doesn't work: Code:
var flickrLinks = document.flickr.getElementsByTagName("a");
for (var i=0; i<flickrLinks.length; i++){
flickrLinks[i].setAttribute("class", "pop");
}
Code:
<div id="flickr"> <div class="flickr_badge_image"> <a href="#"><img /></a> </div> <div class="flickr_badge_image"> <a href="#"><img /></a> </div> <div class="flickr_badge_image"> <a href="#"><img /></a> </div> ... </div> I guess another solution would be to write a script that pops up any link within the flickr div, but I'm not sure how to do that. |
|
|
|
0
|
|
|
#2 |
|
I would change:
Code:
flickrLinks[i].setAttribute("class", "pop");
):Code:
if (flickrLinks[i].className == 'pop') {
flickrLinks[i].onclick = function () {
window.open(this.getAttribute('href'),'pop');
return false;
}
flickrLinks[i].onkeypress = flickrLinks[i].onclick;
}
}
-Chase |
|
|
|
0
|
|
|
#3 | |
|
Quote:
|
||
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| Intro + Questions (need help) | VideoIdiot | Mac Basics and Help | 3 | Dec 4, 2010 12:28 PM |
| Simple PHP script question | carlosbutler | Web Design and Development | 4 | Mar 21, 2009 06:15 PM |
| Is It Available? (Need Help) | DarkNetworks | Buying Tips, Advice and Discussion (archive) | 40 | Sep 19, 2005 06:06 PM |
| Ventrilo Server On Mac (need help) | TreeHugger | General Mac Discussion | 1 | Jan 18, 2005 12:34 PM |
| At the process of installing AE card (Need Help) | iKwak | Macintosh Computers | 6 | Dec 12, 2003 07:31 PM |
All times are GMT -5. The time now is 08:51 AM.







):
Linear Mode

