Top.Mail.Ru
? ?
Javascript's Journal
 
[Most Recent Entries] [Calendar View] [Friends View]

Monday, June 8th, 2009

Time Event
10:43a
Targeting a sub element to change CSS styles
What I want to do is close all the tab-panels and then open the target panel

Seems like the code could be two lines in a function
function switchPanel(target) 
  {
  [display:none all elements with class="panel"]
  document.getElementById(target).style.display = "inline";
  }

Any ideas?

*
This is for a set of tabs and panels. I already know how to do by id-ing all the panels and looping through an array to close them all then open the requested one, but I am looking for fewer lines of code that requires less id-tags (genral solution)

I've done it before by
document.getElementById(panelsetname).getElementsByTagName('div')

But then you can't have any sub divs. I've looked online but all the solutions I have found are longer than the one I am already using.
3:16p
Couloir Slideshow Captions
 Hello everybody,
This is a slideshow that I used and adapted for one of my website — original site is: http://www.couloir.org/js_slideshow/

Is there an easy way to make the captions link to different pages within a website. I appreciate any help I can get.

This the code that defines photos and their attributes (from the file called slideshow.js). Do I need to create a href function? If so, how can I do it?
Please help.

// Define each photo's name, height, width, and caption
var photoArray = new Array(
// Source, Width, Height, Caption
new Array("IMG_0470.jpg", "600", "450", "Cycling from Telluride to Moab"),
new Array("IMG_2441.jpg", "582", "350", "Mt. Toll as seen from the slopes of Mt. Audubon"),
new Array("IMG_2449.jpg", "600", "300", "Taking flight from the summit of Paiute"),
new Array("IMG_0677.jpg", "650", "488", "Plodding up Queen's Way Couloir on Apache"),
new Array("P3220073.jpg", "600", "400", "A storm brews in the distance (Red Rocks, NV)")
);
 
Thanks :)
4:51p
Blur / removing the browser selection box
I am not a big user of blur(), but for the tab-panel app I have below I want to get rid of the box the browser is drawing around the tab some one just clicked. I thought I could use blur(this) or this.blur() or even onfocus="blur(this)" but all versions are blurring the entire window not just the element selected/highlighted.

Any ideas

<< Previous Day 2009/06/08
[Calendar]
Next Day >>
About LiveJournal.com
Image