TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-22-2009, 04:55 PM   #1 (permalink)
The Acquainted
 
buildakicker's Avatar
 
Join Date: Jan 2008
Posts: 119
Thanks: 21
buildakicker is on a distinguished road
Terminal Open Accordion if Anchor Selected

Hi all,

So I am sure this is possible, but not sure how to implement it.

I have a link on a page that when clicked opens another page that contains a list of items with subitems that are contained in a closed accordion. I would like to click on the first page's link and have it load the second page and open the corresponding accordion list.

For example:
HTML Code:
<a href="link1.html#acord1>Link 1</a>, found on page.html, opens link1.html and anchors to #acord1. #acord1, by default, is a closed accordion. How can I have #acrod1 an open accordion when I click on the link1.html#acord1 on page.html?
There are multiple selections on link1.html... #acord1, #acord2, #acord3... etc...

Thanks!
__________________
SkiLeases.com
buildakicker is offline  
Reply With Quote
Old 12-23-2009, 01:40 AM   #2 (permalink)
The Addict
 
Join Date: May 2009
Posts: 287
Thanks: 5
adamdecaf is on a distinguished road
Default

> I would like to click on the first page's link and have it load the second page and open the corresponding accordion list.

I'm going to assume that the <a>'s are set up similar to this.

Code:
 <a href="about.php#contact">Contact</a>
 <a href="about.php#work">Our Projects</a>
javascript Code:
window.onload = function () {
   var hash = window.location.hash.substr(1);

  // You grab the assoicated element with the hash gathered from
  // [url]http://domain.tld/about.php#contact[/url]
  // If you're going to assign multiple css properties then I would
  // suggest creating a variable and putting in multiple statements.
   document.getElementById(hash).style.height = '250px';

  // Or
  var elm = document.getElementById(hash);
      elm.style.height = '250px';
      elm.style.border = '1px solid 000000';
      elm.style.cursor = 'pointer';
}
__________________
My Site
adamdecaf is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dingo Framework - ALPHA Testing Open! ETbyrne Show Off 97 10-18-2012 02:11 PM
Looking for partner(s) for open source framework Scottymeuk General 4 02-06-2009 12:05 AM
php open source coolbug General 5 11-22-2008 04:05 AM
Porn CMS Open Source? 9three Advanced PHP Programming 4 11-07-2008 02:26 PM
Notepage like application to open large MySQL files Wildhoney General 6 12-07-2007 02:18 PM


All times are GMT. The time now is 08:37 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design