Skip to content

Instantly share code, notes, and snippets.

@pol
Created July 29, 2008 19:39
Show Gist options
  • Save pol/3156 to your computer and use it in GitHub Desktop.
Save pol/3156 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
//<![CDATA[
//haHA This works! It could probably use some refactoring.
$(document).ready(function(){
$(".help_icon").click(function(){
help_icon = $(this);
help_container = help_icon.parent();
help = help_icon.siblings('.help_dialog');
help.css('display','block')
help.dialog({
close: function(){
help.css('display','none');
help_container.append(help);
}
});
});
});
//]]>
</script>
<p>Item 1
<span class="help_container">
<img class="help_icon" title="Click for more information." src="/images/icons/help.gif" alt="help alt"/>
<div class="help_dialog">Help Text for Item1</div>
</span>
</p>
<p>Item 2
<span class="help_container">
<img class="help_icon" title="Click for more information." src="/images/icons/help.gif" alt="help alt"/>
<div class="help_dialog">Help Text for the Item2</div>
</span>
<p>Item 3
<span class="help_container">
<img class="help_icon" title="Click for more information." src="/images/icons/help.gif" alt="help alt"/>
<div class="help_dialog">Help Text for the Item3</div>
</span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment