9

Access to the background image in gsp in grails

 2 years ago
source link: https://www.codesd.com/item/access-to-the-background-image-in-gsp-in-grails.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Access to the background image in gsp in grails

advertisements
<div id="Canvas"
 style="background-image: url(../../assets/images/doctor/ecg/ecg_back.png);
 position:relative; height:250px;width:1000px;">

how to access the image present in assets/images/doctor/ecg/ecg_back.png from the set the background image in gsp present in the views/ECGView.gsp


You should be able to access the image as a resource.

<div id="Canvas" style="background-image:url('${resource(dir: "images/doctor/ecg/", file: "ecg_back.png")}');height: 250px;background-repeat: no-repeat;background-position: center;width:1000px;">

Related Articles

How to access the local image when setting the background image in javascript

My goal is to set the background image from a local image on my computer. I have two lines of code, one that works and one that doesn't: (the local one does not work) _html.style.backgroundImage = 'url("urlsourceblahblahblah")'; _html.style.back

How to change the background image on the Android app?

I have several images, and I want the app user to be able to change the background image of the current activity he is in. How can I be able to do this?You use a typed array in arrays.xml file within your res folder that looks like this: <?xml versio

CSS: Set the background image in CSS

What is the correct syntax when setting the background-image in CSS? In visual studio, there seems to be no problem in the background since it appears. But in the browser like IE or FF, the background does not appear. is there something i missed here

How do I determine the background image URL of a div via JavaScript?

I've found plenty of information on how to change the background image of a div using JavaScript, but I am trying to use JavaScript to determine which background image is being displayed. The code to set the image goes like this: document.getElementB

Attribute property binder for the background image URL in Angular 2

I have been struggling to figure out the best way to dynamically change the background-image attribute in a number of Angular 2 components. In the following example, I am attempting to set the background-image of a div to an @Input value using [ngSty

The background image does not indicate the image

I have designed an html css theme. It is not running on any server or localhost. I kept the theme including all its css js files in one directory. Its path is D -> website -> theme. In the html file I used several images. My html code for image is `

UINavigationController - Keep the background image across all views

Possible Duplicate: UINavigationBar appearance override in iOS 5 Is there a way to have a background image remain constant across all views in a navigation controller? Currently I am loading the same background in each view's viewDidLoad method but t

How to change the background image when using the Facebook Unity SDK

I'm using the Unity Facebook SDK to set up my Unity game in Facebook. I've setup the app using 'Unity integration enabled' and the game works as desired. I would like to change the background image of the webpage from plain white to a bitmap image. I

Change the background image of a button (the button is super class) in Xcode

I have inherited my custom class in my project.i.e instead of using the UIViewController i have inherited my custom class.That custom class is having the button.When I am in firstViewController i have to change the background image of that button.for

Change the background image in WPF by using C #

This question already has an answer here: Change WPF window background image in C# code 6 answers I'd like to change the background image of my WPF application by a button. I know how to do it using WindowsForms, but in WPF I failed. I found a soluti

How do you set the background image to keep its position while the width of the browser changes?

I am wondering how I could set the background image to keep its position on this site: http://www.jylkkari.fi/wordpress/ When you drag the browser under 960 px wide, the background of sidebar starts to move towards center. I found out this Javascript

Reactive menu on the background image

I have a responsive menu on top of the background image. <div class="header-slides" data-slides='["https://picjumbo.imgix.net/HNCK1654.jpg?q=40&w=1650&sharp=30", "https://picjumbo.imgix.net/HNCK2106.jpg?q=40&w=1650&

Changing the background image on the click (jQuery)

I was wondering if anyone could tell me why this isn't working. I just want the background image to change when the div (with id "el") is clicked. It should change from "elephant coloured1" to "elephant coloured2" but its not

The background image does not work

I have the background image for a basic rails site I made working fine but when I pushed it up to heroku it gave me the following error Failed to load resource: the server responded with a status of 404 (Not Found) http://young-oasis-2855.herokuapp.c

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK