Jump to content

Recommended Posts

Hi there,

 

I really hope someone can help me out on this. I've got a list of items generated using a php script:

 

http://www.liftedmusic.co.uk/home/index.php?option=com_podcast&view=album&id=&Itemid=38

 

Upon clicking on track listing, text should expand for that item. I am not sure how to get this to work for each item without opening the wrong tracklisting (of another item) upon clicking an items track listing.

 

If you click PODCAST013, the top podcast track listing opens.

 

The script code is below:

 

		<div class="div1" onclick="expand('text1', this);"><h2 class="tracklistingtext">TRACKLISTING +</h2></div>

		<span id="text1" style="display:none;">

		<div class="tracklistingitems">
		<?php echo $this->detail_album->review; ?>  <---- This displays the text for tracklisting
		</div>

		</span>

 

 

This is the javascript code I am using:

 

 

	<script type="text/javascript">
function expand(thistag, tag) {
   styleObj=document.getElementById(thistag).style;
   if (styleObj.display=='none')
   {
   	styleObj.display='';
	tag.innerHTML = "<h2 class=\"tracklistingtext\">TRACKLISTING:</h2>";
   }
   else {
   	styleObj.display='none';
    tag.innerHTML = "<h2 class=\"tracklistingtext\">TRACKLISTING +</h2>";
   }
}
</script>

 

I'd much appreciate it if someone could help me out, or at least tell me if its possible to do what I want.

 

Thanks so much!

 

It looks like you're trying to use the same name for the different tracklists...

 

You need to tell the link you're clicking to open the proper list by giving the divs holding them unique names (right now they both have the id "text1").

 

Not familiar with Joomla, but viewing the source of your link, there is a lot of stuff going on in there not the least of which is multiple head and body sections.

 

good luck

Thanks for the reply matt.

 

How would I go about setting unique names for each div in a script that generates each item automatically? Could I use the id the script generates for each item? I know whats there, but im not sure how to piece it together. Any ideas?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.