DEVHIDE
  • Home (current)
  • About
  • Contact
  • Cookie
  • Home (current)
  • About
  • Contact
  • Cookie
  • Disclaimer
  • Privacy
  • TOS
Login Or Sign up

How to remove one image from banner?

205 Views Asked by min moica At 08 September 2017 at 02:23 2025-12-12T23:33:42.122000

Let say I have a banner image group.

<div class="bannerWrap">
<div class = "banner style="left: 0px;">
<img src = "something.jpg"  id="a">
<img src="something2.jpg" id="b">

</div>
</div>

When I move the banner image, only the banner style will be to change if I want to remove an image file in certain banner location

any good idea?

jquery html css banner
Original Q&A
3

There are 3 best solutions below

0
Spencer Cousins Spencer Cousins On 08 September 2017 at 02:29

You could try changing the opacity with CSS like this:

#a {
    opacity : 0;
}
0
bellabelle bellabelle On 08 September 2017 at 02:43

Try below code on your JS to remove the image with an id name of a.

$('#a').remove();
0
I haz kode I haz kode On 08 September 2017 at 02:43

If you want to move image #a without effecting image #b then set image #a to position:relative

This allows you to modify the position of image #a relative to its original position without affecting the position of image #b

Here's what MDN docs say about position:relative:

... The element is positioned according to the normal flow of the document, and then offset relative to itself based on the values of top, right, bottom, and left. The offset does not affect the position of any other elements; thus, the space given for the element in the page layout is the same as if position were static.

This value creates a new stacking context when the value of z-index is not auto. The effect of relative on table-*-group, table-row, table-column, table-cell, and table-caption elements is undefined.

basic example:

.bannerWrap {
  border: 1px solid red;
  background: #111;
  display: inline-block;
}

#a {
  position: relative;
  top: 40px;
  left: 200px;
}
<div class="bannerWrap">
  <div class="banner">
    <img id="a" src="https://unsplash.it/300/300" alt="Image #a">
    <img id="b" src="https://unsplash.it/300/301" alt="Image #b">
  </div>
</div>

if you want to remove image #a completely without affecting the layout you can use visibility:hidden

MDN docs on visibility:hidden:

... The element box is invisible (not drawn), but still affects layout as normal. Descendants of the element will be visible if they have visibility set to visible. The element cannot receive focus (such as when navigating through tab indexes).

basic example:

.bannerWrap {
  border: 1px solid red;
  background: #111;
  display: inline-block;
}

#a {
  visibility: hidden
}
<div class="bannerWrap">
  <div class="banner">
    <img id="a" src="https://unsplash.it/300/300" alt="Image #a">
    <img id="b" src="https://unsplash.it/300/301" alt="Image #b">
  </div>
</div>

Related Questions in JQUERY

  • How to sort these using Javascript or Jquery Most effectively
  • Ajax jQuery firing multiple time display event for the same result
  • .hover() seems to overwrite .click()
  • Check for numeric value with optional commas javascript
  • Extending Highmaps Side Effect
  • Array appending after each onclick and loop in javascript
  • how can i append part of a table based on how many tr it has?
  • Play multiple audio files in a slider
  • Remove added set of rows
  • Access property of an object of type [Model] in JQuery
  • AJAX PHP - Reload div after submit
  • proengsoft/laravel-jsvalidation ReferenceError: jQuery is not defined
  • when a checkbox is checked how to display a different hidden element using javascript
  • Get jquery error Uncaught RangeError: Maximum call stack size exceeded
  • Removing only the closest thead on table filtering

Related Questions in HTML

  • Delay in loading Html Page(WebView) from assets folder in real android device
  • Why does a function show up as not defined
  • CSS Class is not applying to element (border width,color,and style attributes)
  • How to sort these using Javascript or Jquery Most effectively
  • how to fill out the table with next values in array with one button
  • Automatically closing tags in form input?
  • Positioning child at bottom of parent with scroll
  • Remove added set of rows
  • Website zoomed out on Android default browser
  • Twitter Bootstrap horizontal form elements on a line
  • http://sigmajs.org/ les mis tutorial - why are my canvases 0 height?
  • My navbar is not expanding after collapse
  • when a checkbox is checked how to display a different hidden element using javascript
  • Gaps Vertically Using Dividers
  • Svg containers not positioning properly

Related Questions in CSS

  • CSS Class is not applying to element (border width,color,and style attributes)
  • How do I find the fonts that are not loading in a CORS situation ( MoovWeb )?
  • Positioning child at bottom of parent with scroll
  • Play multiple audio files in a slider
  • How to set text over image?
  • Website zoomed out on Android default browser
  • Writing/Overwriting to specific XML file from ASP.NET code behind
  • My navbar is not expanding after collapse
  • when a checkbox is checked how to display a different hidden element using javascript
  • Gaps Vertically Using Dividers
  • CSS: Preventing a property to affect on element until the end of transition
  • Polygon Button with pure CSS
  • transform-origin doesnt apply in safari
  • show/hide multiple div tags at once and change the size of the remaining div tag
  • Mask the image/maps/div (circle) using css and jquery

Related Questions in BANNER

  • How can I make an include unaffected by style/CSS?
  • I Can't Auto-Adjust The Banner
  • Huge Banner Padding
  • How to syncronize iframes (html5-banner)?
  • How to get href from iframe/script and redirect to it
  • How to make a closable banner in pure javascript
  • Banner Image Placement and Proportion
  • How to create a iAd banner?
  • Placing banner above the Bootstrap 3 navbar?
  • Cross domain PHP or AJAX (or else) for use in dynamic banners
  • Wraparound Banner with CSS
  • How to stop a DoubleClick interstitial
  • After click AdMob ads, I cannot return to my Android app by back button
  • Banner rotation in JavaScript with animation using CSS3
  • How to remove one image from banner?

Trending Questions

  • UIImageView Frame Doesn't Reflect Constraints
  • Is it possible to use adb commands to click on a view by finding its ID?
  • How to create a new web character symbol recognizable by html/javascript?
  • Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
  • Heap Gives Page Fault
  • Connect ffmpeg to Visual Studio 2008
  • Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
  • How to avoid default initialization of objects in std::vector?
  • second argument of the command line arguments in a format other than char** argv or char* argv[]
  • How to improve efficiency of algorithm which generates next lexicographic permutation?
  • Navigating to the another actvity app getting crash in android
  • How to read the particular message format in android and store in sqlite database?
  • Resetting inventory status after order is cancelled
  • Efficiently compute powers of X in SSE/AVX
  • Insert into an external database using ajax and php : POST 500 (Internal Server Error)

Popular # Hahtags

javascript python java c# php android html jquery c++ css ios sql mysql r reactjs

Popular Questions

  • How do I undo the most recent local commits in Git?
  • How can I remove a specific item from an array in JavaScript?
  • How do I delete a Git branch locally and remotely?
  • Find all files containing a specific text (string) on Linux?
  • How do I revert a Git repository to a previous commit?
  • How do I create an HTML button that acts like a link?
  • How do I check out a remote Git branch?
  • How do I force "git pull" to overwrite local files?
  • How do I list all files of a directory?
  • How to check whether a string contains a substring in JavaScript?
  • How do I redirect to another webpage?
  • How can I iterate over rows in a Pandas DataFrame?
  • How do I convert a String to an int in Java?
  • Does Python have a string 'contains' substring method?
  • How do I check if a string contains a specific word?
.

Copyright © 2021 Jogjafile Inc.

  • Disclaimer
  • Privacy
  • TOS
  • Homegardensmart
  • Math
  • Aftereffectstemplates