update dialog title for each click

Posted by Scarface on Stack Overflow See other posts from Stack Overflow or by Scarface
Published on 2010-05-12T18:49:19Z Indexed on 2010/05/12 18:54 UTC
Read the original article Hit count: 151

Filed under:

Hey guys I have a quick question, I have a dialog box that has multiple links with different attributes. Each time a link is clicked, the attribute src is printed inside of the dialog box so that each link has a unique output in the dialog. My problem is simply that only the first src title is in every box and I would like to change that as well with each click. I separated the line containing title to show the problem. If anyone has any ideas I would appreciate it.

<a class="open" src="something" title="Click to play">link</a>
<a class="open" src="something else" title="Click to play">link2</a>

$('.open').click(function() {
src=$(this).attr('src');
$('#show').html(''+src+'');                  
$(\"#show\").dialog({hide: 'clip', width: 400,height: 150,position: 'center',

show: 'clip',stack: true,title: ''+src+'', minHeight: 25,

minWidth: 100, autoOpen: false,resizable:false});
$('#show').dialog('open');
        })

© Stack Overflow or respective owner

Related posts about jQuery