javascript - Copy all identified class to another class -
if click on map, copy classes class li class="salony" id="wojewodztwo-malopolskie"
class <div id="spissalonow">
. it's works correctly.
how can that, when choice krakow select
(selector),should copy classes name krakow <div class="krakow">
class <div id="spissalonow">
?
$( document ).ready(function() { $("svg").delegate("*", "click", function(e) { $('.st0').removeattr('style'); var id = $(this).attr('id'); $(this).css("fill", "#ff6600"); //$('#spissalonow').stop().slidedown("slow").css('opacity', '0').html($('#wojewodztwo-' + id).html()).animate({opacity: 1}, 1000).slidedown(500); $('#spissalonow').stop().slidedown("slow").css('opacity', '0').html($('#wojewodztwo-malopolskie').html()).animate({opacity: 1}, 1000).slidedown(500); }); $("select" ).change(function() { var alllistelements = $(".krakow"); $( "#spissalonow > div" ).find( alllistelements ); var liczbasalonow = jquery('.' +$(this).val()).length; //alert(jquery('.' +$(this).val()).length); $('#spissalonow').stop().slidedown("slow").css('opacity', '0').html($('.' + $(this).val()).html()).animate({opacity: 1}, 1000).slidedown(500); alert( $(this).val() ); }); });
https://jsfiddle.net/4q8ud1pw/7/
is wanted?
thanks (jquery html of container including container itself) showing me how include container.
$("select" ).change(function() { var html = ''; $(".krakow").each(function(){ html += $(this).wrap('<p/>').parent().html(); }); $('#spissalonow').stop().slidedown("slow").css('opacity', '0').html(html).animate({opacity: 1}, 1000).slidedown(500); });
Comments
Post a Comment