Created
February 8, 2018 01:12
-
-
Save sxidsvit/5a0e4fab456908ed2876d4d271dfcfd1 to your computer and use it in GitHub Desktop.
Перемещение DOM-элементов из карточки товара в лайтбокс (А.Ладовер)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var setlbox = function(el) { | |
var p=$(el); | |
this.image = function (fromclass,toclass) { | |
var f=p.find('.'+fromclass); | |
$('.'+toclass).attr('src',f.attr('src')); | |
} | |
this.text = function (fromclass,toclass) { | |
var f=p.find('.'+fromclass); | |
$('.'+toclass).text(f.text()); | |
} | |
this.list = function (fromclass,toclass) { | |
var fclass='.'+fromclass, dclass='.'+toclass, f=p.find(fclass); | |
$(dclass).html('').text(''); | |
f.clone().appendTo($(dclass)); | |
$(dclass).children(fclass).addClass('new_div_visible'); | |
$('.new_div_visible').css({'display':'block','opacity':'1'}); | |
} | |
}; | |
function show_post(el) { | |
var move = new setlbox(el); | |
move.image('team_image','image_teams'); | |
move.text('team_name','ld_teams_name'); | |
move.text('team_spec','lb_teams_spec'); | |
move.text('team_u','lb_teams_phdesc'); | |
move.list('list_teams_wr','lb_list_item'); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment