I have a function called "Colorbox" (jQuery plugin) that takes a few parameters, for example:
$(this).colorbox({ width : "500px", height : "500px" });
I have several different types of "this", although each with its own properties. For example:
var Type = { video: { width : "500px", height : "500px" }, gallery: { width : "1065px", height : "600px" } }
In addition, I have other behavior, logic, and a group of default settings (which are overwritten with more specific ones). What I'm trying to do is push all the relevant settings from several objects into one object, so that I can simply call:
$(this).colorbox(Settings);
How can I pass an unknown group of properties and their values (for example, "width" and "height") from something like Type.video into the settings? The goal is to be able to call Settings.height and return the value I clicked.
javascript jquery
Doug Avery Aug 26 '09 at 13:23 2009-08-26 13:23
source share