Solved

Javascript backgroundColor - How To Set To Transparent

Posted on 2013-12-13
9
590 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

747 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

12 Experts available now in Live!

Get 1:1 Help Now