javascript - One button, mulitple links. Link changes depending on which div is open -
so asked question got overly complicated , think it's buried because i'm not getting new answers.
to see i'm trying change you'll have google red ink themeforest. i'm using portfolio page of template.
when click 1 of portfolio items "true gangsters" info pulled div , plugged previous section formatting.
all want add button links youtube videos these portfolio items , able pull link div , have formatted button.
in jsfiddle included formatted div , "true gangsters" section formatted div gets info from.
i included of portfolio part javascript i'm pretty sure important part:
//update text info function updatetext(current) { var title = current.attr('data-title'); var desc = current.attr('data-description'); var date = current.attr('data-date'); controls.find('h2').html(title); controls.find('p').html(desc); controls.find('.date .day').html(date.split(',')[0]); controls.find('.date .month').html(date.split(',')[1]); controls.find('.date .year').html(date.split(',')[2]); } //end update text info
all i've added code is
<div class="button"></div>
into portfolio item formatting section , data-video="cdddy5nva3a"to first portfolio item.
var current = $(".onehalf"), controls = $("div"); var endlink = current.data('video'); var fulllink = '<a href="https://www.youtube.com/watch?v=' + endlink +'">"click video"</a>'; controls.filter('.button').html(fulllink);
this code snippet written dontvotemedown in last question(with few changes fit new question) , works doesn't insert new link each portfolio item generates 1 link of portfolio items when want each 1 different. didn't explain myself last time.
edit 1: still no progress. ideas @ all? edit 2: going crazy! bit off more can chew
Comments
Post a Comment