Widget:CampaignCards: Difference between revisions
imported>Pillowkeeper No edit summary |
imported>Pillowkeeper No edit summary |
||
| Line 28: | Line 28: | ||
var id = card.id | var id = card.id | ||
var height = $(card).attr("data-height"); | var height = $(card).attr("data-height"); | ||
if(!$("div#" + id).hasClass("opened")){ | |||
$("div#" + id + " div:not('.campaignbox-content')").fadeToggle('slow'); | $("div#" + id + " div:not('.campaignbox-content')").fadeToggle('slow'); | ||
$(".campaignbox:not('div#" + id + "')").hide(); | $(".campaignbox:not('div#" + id + "')").hide(); | ||
$("div#" + id).animate({width:'650px', height: height}, function(){ | $("div#" + id).animate({width:'650px', height: height}, function(){ | ||
$(".campaignbox:not('div#" + id + "')").fadeOut(); | $(".campaignbox:not('div#" + id + "')").fadeOut(); | ||
| Line 37: | Line 36: | ||
$("div#" + id + " div:not('.campaignbox-content')").hide('slow'); | $("div#" + id + " div:not('.campaignbox-content')").hide('slow'); | ||
$("div#" + id + " .campaignbox-content").show('slow'); | $("div#" + id + " .campaignbox-content").show('slow'); | ||
$("div#" + id).toggleClass("opened"); | |||
$("div#" + id). | |||
} | } | ||
} | } | ||
</script> | </script> | ||
Revision as of 12:00, 30 August 2017
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.1.min.js"></script>
<script> var series1 = [];
var obj = {};
obj["name"] = ""; obj["image"] = ""; obj["season"] = ""; obj["content"] = ; obj["key"] = ""; obj["height"] = "";
series1.push(obj);
for(var i = 0; i < series1.length; i++){ console.log(series1[0].image);
$(".campaign-holder").append('
'+ series1[i].season +'
' + series1[i].name + '
');
}
function openCard(card){
var id = card.id var height = $(card).attr("data-height"); if(!$("div#" + id).hasClass("opened")){ $("div#" + id + " div:not('.campaignbox-content')").fadeToggle('slow'); $(".campaignbox:not('div#" + id + "')").hide(); $("div#" + id).animate({width:'650px', height: height}, function(){ $(".campaignbox:not('div#" + id + "')").fadeOut(); }); $("div#" + id + " div:not('.campaignbox-content')").hide('slow'); $("div#" + id + " .campaignbox-content").show('slow'); $("div#" + id).toggleClass("opened"); } } </script>
<style> .character-portrait {
object-fit: cover; width: 60px; height: 125px; margin: 3px;
} .campaignbox.opened {
width: 650px; height: 184px; border: 3px solid white; border-radius: 10px; overflow: hidden; display: inline-block; background: rgb(33, 33, 33); margin: 8px;
} .campaignbox {
width: 200px; height: 184px; border: 3px solid white; border-radius: 10px; overflow: hidden; display: inline-block; background: rgb(33, 33, 33); margin: 8px;
} .campaignbox-card {
cursor: pointer;
} .campaignbox-image {
width: 100%; opacity:0.85; margin-bottom: -5px;
} .campaignbox-text {
padding: 0.01em 5px; color: white; text-align: center;
} .campaignbox-content {
display: none; color:white; padding: 16px; }
</style>


