Forums › Forums › Slimbox2 plugin › "Download this image" doesnt work
- This topic has 21 replies, 6 voices, and was last updated 12 years, 9 months ago by malcalevak.
-
AuthorPosts
-
July 16, 2011 at 5:00 pm #9351NobzMember
I’m having the same problem, I copied simbox2_autoload.js of Ayrthon but not works for me.
I fixed the problem, here my slimbox2_autoload.js:[code:3do9f1x8]
jQuery(document).ready(function($) {
if(slimbox2_options[’mobile’] || !/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)){
slimbox_CSS();
closeKeys = slimbox2_options[’closeKeys’].split(‘,’);
previousKeys = slimbox2_options[’previousKeys’].split(‘,’);
nextKeys = slimbox2_options[’nextKeys’].split(‘,’);
for ( var i in closeKeys) closeKeys[i] = parseInt(closeKeys[i]);
for ( var i in previousKeys) previousKeys[i] = parseInt(previousKeys[i]);
for ( var i in nextKeys) nextKeys[i] = parseInt(nextKeys[i]);
load_slimbox();
}
});
function slimbox_CSS() {
jQuery(function($) {
$("#lbOverlay").css("background-color",slimbox2_options[’overlayColor’]);
$("#lbPrevLink").hover(
function () {
$(this).css("background-image","url("+slimbox2_options["prev"]+")");
},
function () {
$(this).css("background-image","");
}
);
$("#lbNextLink").hover(
function () {
$(this).css("background-image","url("+slimbox2_options["next"]+")");
},
function () {
$(this).css("background-image","");
}
);
$("#lbCloseLink").css("background-image","url("+slimbox2_options["close"]+")");
})};function load_slimbox() {
jQuery(function($) {
var options = {
loop: slimbox2_options[’loop’],
overlayOpacity: slimbox2_options[’overlayOpacity’],
overlayFadeDuration: parseInt(slimbox2_options[’overlayFadeDuration’]),
resizeDuration: parseInt(slimbox2_options[’resizeDuration’]),
resizeEasing: slimbox2_options[’resizeEasing’],
initialWidth: parseInt(slimbox2_options[’initialWidth’]),
initialHeight: parseInt(slimbox2_options[’initialHeight’]),
imageFadeDuration: parseInt(slimbox2_options[’imageFadeDuration’]),
captionAnimationDuration: parseInt(slimbox2_options[’captionAnimationDuration’]),
counterText: slimbox2_options[’counterText’],
closeKeys: closeKeys,
previousKeys: previousKeys,
nextKeys: nextKeys
}if(slimbox2_options[’autoload’]) {
$("a[href]").filter(function() {
return /.(jpeg|bmp|jpg|png|gif)(?[dw=&]*)?$/i.test(this.href);
}).unbind("click").slimbox(options, function(el) {
return [encodeURI(el.href), (slimbox2_options[’url’])?'<a href="’ + encodeURI(el.href) + ‘">’+eval(slimbox2_options[’caption’])+'</a>’:eval(slimbox2_options[’caption’])];
}, function(el) {
return (this == el) || ($(this).closest(slimbox2_options[’selector’])[0] && ($(this).closest(slimbox2_options[’selector’])[0] == $(el).closest(slimbox2_options[’selector’])[0]));
});
} else {
$("a[rel^=’lightbox’]").unbind("click").slimbox(options, function(el) {
return [encodeURI(el.href), (slimbox2_options[’url’])?'<a href="’ + encodeURI(el.href) + ‘">’+eval(slimbox2_options[’caption’])+'</a>’:eval(slimbox2_options[’caption’])];
}, function(el) {
return (this == el) || ((this.rel.length > && (this.rel == el.rel));
});
}/*
HERE THE CODE OF DOWNLOAD IMAGE BUTTON
*/
jQuery(function($) {
$("a[rel^=’lightbox’]").slimbox({/* Put custom options here */}, function(el) {
return [el.href, el.title + ‘<br /><a href="’ + el.href + ‘" target="_self"><img src="http://youdomai.com/images/downloadimg.gif" width="100" height="22" border="0" title="Download Image" /></a>’];
}, function(el) {
return (this == el) || ((this.rel.length > && (this.rel == el.rel));
});
});/*
END DOWNLOAD IMAGE CODE BUTTON
*/
if(slimbox2_options[’picasaweb’]) {
$("a[href^=’http://picasaweb.google.’] > img:first-child[src]").parent().unbind("click").slimbox(options, function(el) {
return [el.firstChild.src.replace(//sd+(?:-c)?/([^/]+)$/, "/s640/$2"),
(el.title || el.firstChild.alt) + ‘<br /><a href="’ + encodeURI(el.href) + ‘">Picasa Web Albums page</a>’];
});
}
if(slimbox2_options[’flickr’]) {
$("a[href^=’http://www.flickr.com/photos/’] > img:first-child[src]").parent().unbind("click").slimbox(options, function(el) {
return [el.firstChild.src.replace(/_[mts].(w+)$/, ".$1"),
(el.title || el.firstChild.alt) + ‘<br /><a href="’ + encodeURI(el.href) + ‘">Flickr page</a>’];
});
}
})};[/code:3do9f1x8]
Hope this helps someone.
July 18, 2011 at 10:04 am #9352Shirly BrazellMemberWordPress plugin is for?
July 19, 2011 at 2:38 am #9353malcalevakModeratorI’m not sure I understand what you’re asking, Shirly.
July 25, 2011 at 3:48 am #9354Yen DearringMemberThis problem solved?
July 25, 2011 at 6:09 am #9355malcalevakModeratorWhat problem? The original poster wanted to customize the feature, he was able to do so. Not in the best fashion, but in one that works for him.
February 10, 2012 at 3:01 pm #9356krstepMemberI’ve tried everything in this thread and I just [b:2olh39dt]can’t add[/b:2olh39dt] the download button.
What I want is to add a download button with image that will go through a php file which will download to a computer. I also need the PHP file since I can’t find one that will do that.
So what i need to edit and how to enable to a Download button?
BTW, the code in FAQ doesn’t work too, I tried everything.
Using version 1.1 and WordPress 3.3.1.Thanks in advance.
February 11, 2012 at 12:33 am #9357malcalevakModeratorThis was a custom modification that someone chose to make to the plugin. Aside from what’s been posted here, I don’t know what to tell you. You can try sending a PM to the guy who came up with his own solution and hope he responds.
-
AuthorPosts
- You must be logged in to reply to this topic.