Terrible title -- sorry.
I'm working with Embedly and have found it somewhat difficult to understand.
My objective is to extract a title and url from an API then list about 25 titles and have a button that when pressed shows the embeded url from embed.ly.
My current struggle is that when I press the button to show the embeded url instead of it only showing for the 1 link that I pressed it decides to show all 25 links at once. Frustrating.
Here is my code:
$('#content').append('<div id="highlight"><h1 id="headline">
<a href="'+URL+'" base target="_blank">'+title+'</a></h1></br>
<img class="dropDown" src="images/drop-down.png" alt=""/>
<a class="embedly-card" href="'+URL+'"></a></div></br>');
$('.embedly-card').hide().removeClass('hide');
So this is working well, embedly-card
is hiding and all is perfect. The part that I am struggling with is:
$(".dropDown").click(function() {
$(this).siblings('.embedly-card').toggle().toggleClass('toggle');
//This is the embedly code that creates the embeded features...
!function(a){var b="embedly-platform",c="script";if(!a.getElementById(b)){var d=a.createElement(c);d.id=b,d.src=("https:"===document.location.protocol?"https":"http")+"://cdn.embedly.com/widgets/platform.js";var e=document.getElementsByTagName(c)[0];e.parentNode.insertBefore(d,e)}}(document);
//End of embedly code...
$(this).toggleClass("on");
So as I said earlier, instead of toggling just the 1 url that I intend it to embed it embeds ALL 25 urls when I click dropDown
and I'm at a loss.
How would I fix this? Thanks.