Skip to main content
added 87 characters in body
Source Link
Mr. M
  • 11
  • 3

Your question is not so clear but what I understand is you wantYou are using css to display none we don't need to use show post-share on click() function.

Please click on share-iconjavascript icon in fiddle and select any jquery1.9.1 or above version . Update this code and run ( http://screenshotlink.ru/8f491216a33e437f762eb8815efec77d.png )

$(document).ready(function () {

$('.post-share').hide(); //this will hide all span with class 'post-share'

  $('.share-icon').clickon('click',function (e) {
       var id = $(this).attr("id").split('-');    
      $('#post'.post-share' + id[2]share#post-share-'+id[2]).showcss("display","block");
   });

});

Your question is not so clear but what I understand is you want to show post-share on click on share-icon

$(document).ready(function () {

$('.post-share').hide(); //this will hide all span with class 'post-share'

  $('.share-icon').click(function () {
      var id = $(this).attr("id").split('-');    
      $('#post-share' + id[2]).show();
  });

});

You are using css to display none we don't need to use show() function.

Please click on javascript icon in fiddle and select any jquery1.9.1 or above version . Update this code and run ( http://screenshotlink.ru/8f491216a33e437f762eb8815efec77d.png )

$(document).ready(function(){

   $('.share-icon').on('click',function (e) {
       var id = $(this).attr("id").split('-'); 
      $('.post-share#post-share-'+id[2]).css("display","block");
   });

});

yourYour question is not so clear but what iI understand is you want to show post-share on click on share-icon

$(document).ready(function () {

$('.post-share').hide(); //this will hide all span with class 'post-share'

$('.share-icon').click(function () { var id = $(this).attr("id").split('-');
$('#post-share' + id[2]).show(); });

});

$(document).ready(function () {

$('.post-share').hide(); //this will hide all span with class 'post-share'

  $('.share-icon').click(function () {
      var id = $(this).attr("id").split('-');    
      $('#post-share' + id[2]).show();
  });

});

your question is not so clear but what i understand is you want to show post-share on click on share-icon

$(document).ready(function () {

$('.post-share').hide(); //this will hide all span with class 'post-share'

$('.share-icon').click(function () { var id = $(this).attr("id").split('-');
$('#post-share' + id[2]).show(); });

});

Your question is not so clear but what I understand is you want to show post-share on click on share-icon

$(document).ready(function () {

$('.post-share').hide(); //this will hide all span with class 'post-share'

  $('.share-icon').click(function () {
      var id = $(this).attr("id").split('-');    
      $('#post-share' + id[2]).show();
  });

});
Source Link
Mr. M
  • 11
  • 3

your question is not so clear but what i understand is you want to show post-share on click on share-icon

$(document).ready(function () {

$('.post-share').hide(); //this will hide all span with class 'post-share'

$('.share-icon').click(function () { var id = $(this).attr("id").split('-');
$('#post-share' + id[2]).show(); });

});