Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createImage(url) {
- var id = loopObject.chatLine.id;
- $(id + ' .message a').html('<img style="width: 250px; margin-left: 25px; box-shadow: 0px 2px 5px #111111; transition: transform 0.5s;" src="'+url+'">');
- $(id + ' .message a img').hover(function(){
- $(id + ' .message a img').css('transform', 'scale(1.1)');
- }, function(){
- $(id + ' .message a img').css('transform', 'scale(1)');
- });
- }
- if (src.toUpperCase().match(/\.(JPEG|JPG|GIF|PNG|SVG)$/)) { //test if direct image link
- imgSrc = src;
- createImage(imgSrc);
- }
- else if (src.substring(0, 17) == 'http://imgur.com/' ) { //else check if imgur non-direct link
- imgSrc = 'http://i.imgur.com/' + src.substring(17, 500) + '.jpg';
- createImage(imgSrc);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement