Highlighted

Click on image B without affect image A

Explorer ,
Apr 01, 2019

Copy link to clipboard

Copied

I have one image (pink "B") included and over another (blue "A") like the follow exemple.

I need to click (onClick) over B and play a sound without play another  sound conect to the image A.  

At my level if I clik on B Is the sound of A ("playThis") that play.

Is there a way to click on B and do not "play" A?

The Image A

<style>   

#Image1{

top: x1px;   

left: x2px;

width: x3px;

height: x4px;

position: absolute;

background-image: y

}

</style>

   

The Image B is set in similar way.

<div onClick ="PlayThis()" id = "ImageA'"></div>

<div onClick ="PlayThat()" id = "ImageB'"></div>

Senza titolo-7.jpg

One way would be to move your onClick events to a <span> tag:

<div  id="Image1">

<span onClick="playThis()"></span>

<div id="Image2">

<span onClick="playThat()"></span>

</div>

<!-- end Image2 -->

</div>

<!-- end Image1 -->

Then style the span tags so they cover their parent container area:

#Image1 span, #Image2 span {

display: block;

height: 100%;

}

TOPICS
Learn Dreamweaver

Views

251

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Click on image B without affect image A

Explorer ,
Apr 01, 2019

Copy link to clipboard

Copied

I have one image (pink "B") included and over another (blue "A") like the follow exemple.

I need to click (onClick) over B and play a sound without play another  sound conect to the image A.  

At my level if I clik on B Is the sound of A ("playThis") that play.

Is there a way to click on B and do not "play" A?

The Image A

<style>   

#Image1{

top: x1px;   

left: x2px;

width: x3px;

height: x4px;

position: absolute;

background-image: y

}

</style>

   

The Image B is set in similar way.

<div onClick ="PlayThis()" id = "ImageA'"></div>

<div onClick ="PlayThat()" id = "ImageB'"></div>

Senza titolo-7.jpg

One way would be to move your onClick events to a <span> tag:

<div  id="Image1">

<span onClick="playThis()"></span>

<div id="Image2">

<span onClick="playThat()"></span>

</div>

<!-- end Image2 -->

</div>

<!-- end Image1 -->

Then style the span tags so they cover their parent container area:

#Image1 span, #Image2 span {

display: block;

height: 100%;

}

TOPICS
Learn Dreamweaver

Views

252

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 01, 2019 0
LEGEND ,
Apr 01, 2019

Copy link to clipboard

Copied

One way would be to move your onClick events to a <span> tag:

<div  id="Image1">

<span onClick="playThis()"></span>

<div id="Image2">

<span onClick="playThat()"></span>

</div>

<!-- end Image2 -->

</div>

<!-- end Image1 -->

Then style the span tags so they cover their parent container area:

#Image1 span, #Image2 span {

display: block;

height: 100%;

}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 01, 2019 1
Explorer ,
Apr 02, 2019

Copy link to clipboard

Copied

Thank you very much Osgood!!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 02, 2019 0