0

SP 2007 / Moss: I have a picture library where I want to show the thumbnail in the list view but make it unclickable. Right now when I click on it, it goes to the display form.

When I go into the picture library settings, there isn't a thumbnail column to edit. I can't even see it in the Picture content type.

Could / Should I use CSS, jQuery or JavaScript to make the link unclickable?

Is there another way without resorting to code?

1

No 2007 handy but depending on your browser coverage you can easily do that with CSS:

.ms-vb-icon a { 
    pointer-events: none
}

.ms-vb-icon is a sample selector from icons in document libraries, you need to identify how to target the column that contains the link with the thumbnail using your Web Developer Tools/Inspector.

https://jsfiddle.net/dmhLc3rx/

EDIT: jquery alternative

$(".ms-vb2 a").on("click", function(e) { 
    e.stopPropagation(); // this stops other click events from firing
    return false; // this stops the browser from following the href attribute
});
  • seems like .ms-vb-icon a is a class on the display form itself. I was looking for it on the allitems page and found that .ms-vb2 a { pointer-events: none;} does the trick. – spex5 Feb 6 '16 at 22:39
  • turns out pointer-events doesn't work in IE. do you know of a way to do this in javascript? – spex5 Feb 8 '16 at 19:18
  • will update it, do you have jquery available? – Francisco Aquino Feb 8 '16 at 23:54
  • Thats great! All I would have to do to use jquery is just reference the latest cdn right? – spex5 Feb 9 '16 at 0:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.