Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hyperLink.Attributes.Add("onclick", "javascript:void(viewer.show(" + picNumberlink + "))");
- <a id="piclink_1" class="picLinks">...</a>
- <a id="picLink_2" class="picLinks">...</a>
- $('a.picLinks').click(function() {
- //split at the '_' and take the second offset
- var picNumber = $(this).attr('id').split('_')[1];
- viewer.show(picNumber);
- });
- var functionIWantToCall = function(){
- var wrappedLink = $(this);
- //some serious action
- }
- //this should be called on document ready
- $("#myLinkId").click(functionIWantToCall);
- var functionIWantToCall = function(event){
- event.preventDefault(); //this one is important
- var link = $(this).attr('href');
- //some serious action
- }
- <a href="..." id="piclink-242" class="view foo-242"><img src="..."/></a>
- $(function() {
- // using the id attribute:
- $('.view').click(function() {
- viewer.show(+/-(d+)/.exec(this.id)[1]);
- });
- // or using the class attribute:
- $('.view').click(function() {
- viewer.show(+/(^|s)foo-(d+)(s|$)/.exec(this.className)[2]);
- });
- }}
- $(document).ready(function()
- {
- $('#LinkID').click(function() {
- viewer.show($(this).attr('picNumber'));
- });
- });
- <%= Html.ActionLink("Index", new { id = "LINKID", picNumber = 1 }) %>
Add Comment
Please, Sign In to add comment