Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 8 votes

Simple Multi Image Add-on (Un-Limited) with FancyBox Popups


957 replies to this topic

#41 datawebuk

  • Community Member
  • 18 posts
  • Real Name:Phil

Posted 21 September 2009, 10:36

Looks simple and with nice effect. Can you give instructions to install this contrib. when STS is already installed?

#42 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 21 September 2009, 12:26

View Postdatawebuk, on Sep 21 2009, 11:36 AM, said:

Can you give instructions to install this contrib. when STS is already installed?

No, I have no sites with STS, ask at the STS thread, someone there should be able to help, if u ask politly!! ;)
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#43 theurbanrooster

  • Community Member
  • 45 posts
  • Real Name:Pete Crebbin

Posted 22 September 2009, 03:03

View Postspooks, on Sep 21 2009, 07:33 PM, said:

Did you apply the instructions to modify product_info.php & upload your changed file?

Remember this modifies the individual product display in product_info.php, not the multiple product listing display in index.php.

Perhaps u need to read How do I install a contribution http://forums.oscommerce.com/index.php?sho...=0#entry1432157

Thanks for the advice & help. The "How do I" is invaluable.
Now, tho I'm getting this message whenever I list a new product:

Warning: Variable passed to each() is not an array or object in /home/theurba4/public_html/admin/categories.php on line 1127

I think I'm getting info-overload...
Thanks again,
pete.

#44 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 22 September 2009, 07:08

theurbanrooster said:


Go over the install again, u missed bits!! You could use the included file.

It does say in that other thread, if u have new errors, triple check your install, most likely missed smthg, why did u think it would be otherwise!!
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#45 fan4chevy

  • Community Member
  • 342 posts
  • Real Name:Charles

Posted 25 September 2009, 18:43

First off, very nice contrib by the way. I use to use Morepics but I think this one is easier and much cleaner than the Lightbox as well.

Interested in the popup arrows easier to locate or stay on top always. See below:

I am noticing that when you have several images that in the popup I can only see the left and right arrows when I put my mouse over them. If you don't know to mouse over a specific area, I think the customer will not know that they can click a button to move forward or back through the images in popup.

Is there a way to make the buttons permanent perhaps at the bottom of the popup? Perhaps right next to or in title of image?

Thanks,

Charles

#46 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 25 September 2009, 20:19

View Postfan4chevy, on Sep 25 2009, 07:43 PM, said:

make the buttons permanent perhaps at the bottom of the popup?


To show always add:
   span#fancy_left_ico {left: 20px; } 
   span#fancy_right_ico {right: 20px;}

to the bottom of fancybox.css

to position at the bottom find:

span.fancy_ico {
 position: absolute; 
 top: 50%;
 margin-top: -15px;
 width: 30px;
 height: 30px;
 z-index: 112; 
 cursor: pointer;
 display: block;
}


change the top: 50%; to top: 90%; or similar. ;)
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#47 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 26 September 2009, 11:44

How to set vertical position of popup.

There is a solution to this, you must edit the javascript in the js/jquery.fancybox.js file:

find (233)

'top': itemTop,


replace with

'top': '100px',

change the 100px to whatever value suites.
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#48 fan4chevy

  • Community Member
  • 342 posts
  • Real Name:Charles

Posted 26 September 2009, 17:08

Thanks for all the help.

I have searched high and low on specifics of how to get the background webpage to dim or overlay. However, I have been unsuccessful.

What I have seen is to put overlay to true and 0 to 1. I must be doing this in the wrong area. Can you please inform me of the exact code I need to change to dim the background and how to change it?

Thanks so much,

Charles

#49 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 26 September 2009, 19:55

fan4chevy said:


can be done with css, but what has that to do with this??
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#50 fan4chevy

  • Community Member
  • 342 posts
  • Real Name:Charles

Posted 26 September 2009, 20:17

Well, In FancyBox I am wanting to darken the background page with the overlay so the images stand out more and have been totally lost in trying to figure out how to do it.


All I could find is things saying put default false to true and change 0 to 1 but I have not succeeded in changing anything if this is the area to change:
overlayShow: true,
overlayOpacity: 1,
If so the above did not dim my back page and your help is appreciated so I can keep my sanity.

#51 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 26 September 2009, 22:42

fan4chevy said:

I am wanting to darken the background page

Clearly settings for the overlay will not affect the background!.

There is no published method to darken the backgound with fancybox, I suspect there would be issues with the fade effect if such were done.

If you wish to try I suggest you research the jquery plugins.
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#52 fan4chevy

  • Community Member
  • 342 posts
  • Real Name:Charles

Posted 26 September 2009, 23:15

View Postspooks, on Sep 26 2009, 06:42 PM, said:

Clearly settings for the overlay will not affect the background!.

There is no published method to darken the backgound with fancybox, I suspect there would be issues with the fade effect if such were done.

If you wish to try I suggest you research the jquery plugins.

Hi again,

I think it is a standard feature because I have seen it used elsewhere and at the main site it is one of the examples. See the first image on the left that is a red sided house with flowers. It shades the back. http://fancybox.net/example

Also is this not what is meant by overlay or is this something else?

#53 fan4chevy

  • Community Member
  • 342 posts
  • Real Name:Charles

Posted 27 September 2009, 06:09

View Postfan4chevy, on Sep 26 2009, 07:15 PM, said:

Hi again,

I think it is a standard feature because I have seen it used elsewhere and at the main site it is one of the examples. See the first image on the left that is a red sided house with flowers. It shades the back. http://fancybox.net/example

Also is this not what is meant by overlay or is this something else?

Ok I figured it out and it works awesome! I hope my 2 days of frustration will help another add this effect for those not sure what do do to DIM THE BACKGROUND!
------------------------------------------------
Open product_info.php
Look for the area above </head> where you pasted the fancybox code and find: 'overlayShow':

Change 'overlayShow': false to true
Save file and upload to catalog directory.

Now open jquery.fancybox.js and find: overlayOpacity:
Change the 0.3 to 0.4 or 0.6 if you want the dim background darker.

It really makes a difference.

Charles

#54 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 27 September 2009, 20:53

Well done, thanks for the tip.
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#55 fan4chevy

  • Community Member
  • 342 posts
  • Real Name:Charles

Posted 27 September 2009, 23:45

View Postspooks, on Sep 27 2009, 04:53 PM, said:

Well done, thanks for the tip.
Welcome. I am trying to figure out another plug in that will enable you to drag and drop the window to a specified location as well as create some optional styled images such as written out next and previous,etc.

#56 fan4chevy

  • Community Member
  • 342 posts
  • Real Name:Charles

Posted 28 September 2009, 04:34

Make FANCYBOX draggable.

Ok here it is. This plug-In will enable you to have your Fancybox be draggable along with the drag arrowed icon as well. This is not a necessary feature but kind of cool!

As always, back up you work. Said to work fine in Firefox 3.x, Opera 9.1, Safari 4 for Windows beta, Chrome 1.x and IE6 and IE7 (not tested in IE8 yet)

Step1:
Open product_info.php and place the following script in the <head> section. (Anywhere between <head> and </head>)

Step2:
Copy the below code and name the file: jquery.easydrag.handler.beta2.js

Copy the file below here ( unfortunately I don't know how to add this file other then pasting it here:

/**
* EasyDrag 1.5 - Drag & Drop jQuery Plug-in
*
* Thanks for the community that is helping the improvement
* of this little piece of code.
*
* For usage instructions please visit http://fromvega.com/scripts
*/

(function($){

// to track if the mouse button is pressed
var isMouseDown = false;

// to track the current element being dragged
var currentElement = null;

// callback holders
var dropCallbacks = {};
var dragCallbacks = {};

// bubbling status
var bubblings = {};

// global position records
var lastMouseX;
var lastMouseY;
var lastElemTop;
var lastElemLeft;

// track element dragStatus
var dragStatus = {};

// if user is holding any handle or not
var holdingHandler = false;

// returns the mouse (cursor) current position
$.getMousePosition = function(e){
var posx = 0;
var posy = 0;

if (!e) var e = window.event;

if (e.pageX || e.pageY) {
posx = e.pageX;
posy = e.pageY;
}
else if (e.clientX || e.clientY) {
posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
}

return { 'x': posx, 'y': posy };
};

// updates the position of the current element being dragged
$.updatePosition = function(e) {
var pos = $.getMousePosition(e);

var spanX = (pos.x - lastMouseX);
var spanY = (pos.y - lastMouseY);

$(currentElement).css("top", (lastElemTop + spanY));
$(currentElement).css("left", (lastElemLeft + spanX));
};

// when the mouse is moved while the mouse button is pressed
$(document).mousemove(function(e){
if(isMouseDown && dragStatus[currentElement.id] != 'false'){
// update the position and call the registered function
$.updatePosition(e);
if(dragCallbacks[currentElement.id] != undefined){
dragCallbacks[currentElement.id](e, currentElement);
}

return false;
}
});

// when the mouse button is released
$(document).mouseup(function(e){
if(isMouseDown && dragStatus[currentElement.id] != 'false'){
isMouseDown = false;
if(dropCallbacks[currentElement.id] != undefined){
dropCallbacks[currentElement.id](e, currentElement);
}

return false;
}
});

// register the function to be called while an element is being dragged
$.fn.ondrag = function(callback){
return this.each(function(){
dragCallbacks[this.id] = callback;
});
};

// register the function to be called when an element is dropped
$.fn.ondrop = function(callback){
return this.each(function(){
dropCallbacks[this.id] = callback;
});
};

// disable the dragging feature for the element
$.fn.dragOff = function(){
return this.each(function(){
dragStatus[this.id] = 'off';
});
};

// enable the dragging feature for the element
$.fn.dragOn = function(){
return this.each(function(){
dragStatus[this.id] = 'on';
});
};

// set a child element as a handler
$.fn.setHandler = function(handlerId){
return this.each(function(){
var draggable = this;

// enable event bubbling so the user can reach the handle
bubblings[this.id] = true;

// reset cursor style
$(draggable).css("cursor", "");

// set current drag status
dragStatus[draggable.id] = "handler";

// change handle cursor type
$("#"+handlerId).css("cursor", "move");

// bind event handler
$("#"+handlerId).mousedown(function(e){
holdingHandler = true;
$(draggable).trigger('mousedown', e);
});

// bind event handler
$("#"+handlerId).mouseup(function(e){
holdingHandler = false;
});
});
}

// set an element as draggable - allowBubbling enables/disables event bubbling
$.fn.easydrag = function(allowBubbling){

return this.each(function(){

// if no id is defined assign a unique one
if(undefined == this.id || !this.id.length) this.id = "easydrag"+(new Date().getTime());

// save event bubbling status
bubblings[this.id] = allowBubbling ? true : false;

// set dragStatus
dragStatus[this.id] = "on";

// change the mouse pointer
$(this).css("cursor", "move");

// when an element receives a mouse press
$(this).mousedown(function(e){

// just when "on" or "handler"
if((dragStatus[this.id] == "off") || (dragStatus[this.id] == "handler" && !holdingHandler))
return bubblings[this.id];

// set it as absolute positioned
$(this).css("position", "absolute");

// set z-index
$(this).css("z-index", parseInt( new Date().getTime()/1000 ));

// update track variables
isMouseDown = true;
currentElement = this;

// retrieve positioning properties
var pos = $.getMousePosition(e);
lastMouseX = pos.x;
lastMouseY = pos.y;

lastElemTop = this.offsetTop;
lastElemLeft = this.offsetLeft;

$.updatePosition(e);

return bubblings[this.id];
});
});
};

})(jQuery);

End the copy from above here

Step 3:
Upload the above file that you haved named jquery.easydrag.handler.beta2.js to the /images/js folder where all of your other fancybox files are.

Step 4:
Open jquery.fancybox.js and find the code that reads hideOnContentClick : true, and change the true to false.

Step 5:
Upload jquery.fancybox.js to the /images/js folder

I hope you enjoy it!
Charles

Edited by fan4chevy, 28 September 2009, 04:36.


#57 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 28 September 2009, 08:31

fan4chevy said:

Make FANCYBOX draggable.

Well done again, only u missed off some of your instructions!!

Step1:
Open product_info.php and place the following script in the <head> section. (Anywhere between <head> and </head>)

<script type="text/javascript" src="<?php echo DIR_WS_IMAGES ?>js/jquery.easydrag.handler.beta2.js"></script>
<script type="text/javascript">
$(function(){
 // add drag and drop functionality to #fancy_box
 $("#fancy_outer").easydrag();
});
</script>

Step 4 & 5 are not strictly neccessary as that setting has already been set in the head

Thanks for finding that though, I`ll include it in the next release. :)
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#58 theurbanrooster

  • Community Member
  • 45 posts
  • Real Name:Pete Crebbin

Posted 28 September 2009, 09:02

theurbanrooster said:

Go over the install again, u missed bits!! You could use the included file.

It does say in that other thread, if u have new errors, triple check your install, most likely missed smthg, why did u think it would be otherwise!!

Thanks. I didn't think it would be anything but my error. I was only hoping for a point in the right direction... Anyway, still trying. Still can only get one pic on listing, even tho i have uploaded 4.
Thanks for your help.
pete.

#59 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 28 September 2009, 10:26

View Posttheurbanrooster, on Sep 28 2009, 10:02 AM, said:


r u seeing the fancy popup? have u tried using the supplied product_info.php
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#60 Allensbayou

  • Community Member
  • 37 posts
  • Real Name:John
  • Gender:Male

Posted 28 September 2009, 22:28

Hello,
I have been checking and checking the install and I still get the fancy popup box with no picture..
My doc type is..
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
Exactly how it is in the install..
Any Ideas?
Thanks in advance..

Edited by Allensbayou, 28 September 2009, 22:35.

It's not a beer gut, it's padding for my rock hard abs!