Jump to content

SUBIECTE NOI
« 1 / 5 »
RSS
Info Coronavirus/Vaccinare vs Fake News

Cum se monteaza obiectul asta?

Curent AC produs de alternator

GDPR | Algoritm computer vision p...
 Elvetia considera interzicerea el...

Windows Defender recuperare

Hackintosh Ryzen 5600g fara placa...

Cum izolez acest fir?
 rtorrent - scripting

TV LG 49UB850V-ZD, musculita in e...

Montare clapeta antiretur la hota

laptop nou + licenta windows
 Unbelievable - De Necrezut -2019 ...

Recomandare achizitie instant ap...

Cand iau pensia pensionarii a car...

Verificare gaze
 

Schimbare "checkbox" in "button"

- - - - -
  • Please log in to reply
1 reply to this topic

#1
alex05ok

alex05ok

    Member

  • Grup: Members
  • Posts: 375
  • Înscris: 08.11.2007
Buna ziua!

Cum schimb "checkbox" in "button" in exemplul de mai jos, dar sa functioneze la fel?

https://jsfiddle.net/awy7vb4j/

<div id="gallery1">
		<input type="checkbox"value="dog">Dog
		<input type="checkbox"value="cat">Cat
		<input type="checkbox"value="bird">Bird
  <!-- DOG -->
		<img src="https://image.ibb.co/ev36Dx/1.jpg" data_cat="dog">
		<img src="https://image.ibb.co/cyXNmH/2.jpg" data_cat="dog">
		<!-- CAT -->
		<img src="https://image.ibb.co/d3Rttx/3.jpg" data_cat="cat">
		<img src="https://image.ibb.co/npueYx/4.jpg" data_cat="cat">
		<!-- Bird -->
		<img src="https://image.ibb.co/mZE2mH/5.jpg" data_cat="bird">
		<img src="https://image.ibb.co/iWaWfc/6.jpg" data_cat="bird">
	</div>
<script>
		$("#gallery1 input").on("change", function() {
			$("#gallery1 img").css("display", "none");
			$("#gallery1 input:checked").each(function(idx, item) {
								$("#gallery1 img[data_cat*='" + item.value + "']").css("display", "inline");
			})
		})
	</script>


Multumesc!

#2
alex05ok

alex05ok

    Member

  • Grup: Members
  • Posts: 375
  • Înscris: 08.11.2007
Am gasit raspunsul aici:

https://www.w3school...om_checkbox.asp

Anunturi

Bun venit pe Forumul Softpedia!

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Forumul Softpedia foloseste "cookies" pentru a imbunatati experienta utilizatorilor Accept
Pentru detalii si optiuni legate de cookies si datele personale, consultati Politica de utilizare cookies si Politica de confidentialitate