Solved

Javascript backgroundColor - How To Set To Transparent

Posted on 2013-12-13
9
591 Views
Last Modified: 2013-12-13
Hello, all.

I have a canned script that I want to use.

All is fine on it, except the background color - I would like it to be transparent.


I have embedded the script block here:

<script type="text/javascript">
			var grid;

			FWDUtils.onReady(function(){
				grid = new FWDGrid({
					//main settings
					gridHolderId:"myDiv",
					gridPlayListAndSkinId:"playlist",
					showContextMenu:"no",
					//grid settings
					thumbnailOverlayType:"icons",
					addMargins:"yes",
					loadMoreThumbsButtonOffest:4,
					thumbnailBaseWidth:278,
					thumbnailBaseHeight:188,
					nrOfThumbsToShowOnSet:27,
					horizontalSpaceBetweenThumbnails:8,
					verticalSpaceBetweenThumbnails:8,
					thumbnailBorderSize:0,
					thumbnailBorderRadius:0,
					thumbnailOverlayOpacity:.85,


					backgroundColor:"#000000",


					thumbnailOverlayColor:"#FFFFFF",
					thumbnailBackgroundColor:"#FFFFFF",
					thumbnailBorderNormalColor:"#b2b2b2",
					thumbnailBorderSelectedColor:"#009aff",
					//combobox settings
					startAtCategory:1,
					selectLabel:"SELECT CATEGORIES",
					allCategoriesLabel:"All Categories",
					showAllCategories:"no",
					comboBoxPosition:"topleft",
					selctorBackgroundNormalColor:"#FFFFFF",
					selctorBackgroundSelectedColor:"#009aff",
					selctorTextNormalColor:"#009aff",
					selctorTextSelectedColor:"#FFFFFF",
					buttonBackgroundNormalColor:"#FFFFFF",
					buttonBackgroundSelectedColor:"#009aff",
					buttonTextNormalColor:"#009aff",
					buttonTextSelectedColor:"#FFFFFF",
					comboBoxShadowColor:"#000000",
					comboBoxHorizontalMargins:12,
					comboBoxVerticalMargins:12,
					comboBoxCornerRadius:0,
					//ligtbox settings
					addLightBoxKeyboardSupport:"yes",
					showLightBoxNextAndPrevButtons:"yes",
					showLightBoxZoomButton:"yes",
					showLightBoxInfoButton:"yes",
					showLighBoxSlideShowButton:"yes",
					showLightBoxInfoWindowByDefault:"no",
					slideShowAutoPlay:"no",
					lightBoxVideoAutoPlay:"no",
					lighBoxBackgroundColor:"#e0e4e4",
					lightBoxInfoWindowBackgroundColor:"#FFFFFF",
					lightBoxItemBorderColor:"#b2b2b2",
					lightBoxItemBackgroundColor:"#333333",
					lightBoxMainBackgroundOpacity:.8,
					lightBoxInfoWindowBackgroundOpacity:.9,
					lightBoxBorderSize:1,
					lightBoxBorderRadius:0,
					lightBoxSlideShowDelay:4
				});
			})
		</script>

Open in new window




Could you, please, help me to make the "backgroundColor" transparent?


Thank you,
Shane
0
Comment
Question by:lshane
  • 4
  • 4
9 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 39717924
What about : http://www.w3.org/wiki/CSS/Properties/color/RGBA

backgroundColor:rgba(255, 0, 0, 0.0),

See compatibility : http://css-tricks.com/rgba-browser-support/
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39717949
That's assuming your plugin will accept rgba(...) as a valid argument.  I hope it does but but is the plugin you're using.  Do you have any more info on it, docs, api etc
0
 

Author Comment

by:lshane
ID: 39717953
Hi, leakim971.

Thank you for replying.


Yeah, I thought about that, but wasn't sure of the syntax.


I tried yours, just as you have it (no quotes), but it just doesn't load grid at all (photo gallery grid).

I tried with Single and Double quotes = Just defaults to a white-ish background.


I'm not sure if the linked .js files are negating it, or what.


Any other ideas?
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39717959
Have you got a link to the photo gallery grid?  You may be able to target the element from outside of the grid but it would depend on the rendered html.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:lshane
ID: 39717970
Hi, tagit.

I thought of that, too, but not sure.

I will attach the only .js file it is using in the site.
0
 

Author Comment

by:lshane
ID: 39717973
Oops - here's the file.
FWDGrid.js
0
 
LVL 42

Accepted Solution

by:
Rob Jurd, EE MVE earned 500 total points
ID: 39717975
From the demos you could just use css:

#myDiv div:first-child {
    background-color: transparent !important;
}
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39717981
The !important will force it over everything else.
0
 

Author Comment

by:lshane
ID: 39718032
Absolutely BRILLIANT!

Thank you, tagit!!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now