Widget:CampaignCards: Difference between revisions
imported>Pillowkeeper No edit summary |
imported>Pillowkeeper No edit summary |
||
| Line 27: | Line 27: | ||
if(!$("div#" + id).hasClass("opened")){ | if(!$("div#" + id).hasClass("opened")){ | ||
$(".campaignbox:not('div#" + id + "')").hide(); | $(".campaignbox:not('div#" + id + "')").hide(); | ||
$("div#" + id).animate({ | $("div#" + id).animate({height: '380px'}, function(){ | ||
$(".campaignbox:not('div#" + id + "')").fadeOut(); | $(".campaignbox:not('div#" + id + "')").fadeOut(); | ||
}); | }); | ||
| Line 49: | Line 49: | ||
width: 75px; | width: 75px; | ||
height: 150px; | height: 150px; | ||
} | |||
.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 { | .campaignbox { | ||
Revision as of 00:12, 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"] = "";
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
$("div#" + id + " div:not('.campaignbox-content')").fadeToggle('slow'); if(!$("div#" + id).hasClass("opened")){ $(".campaignbox:not('div#" + id + "')").hide(); $("div#" + id).animate({height: '380px'}, function(){ $(".campaignbox:not('div#" + id + "')").fadeOut(); }); $("div#" + id + " div:not('.campaignbox-content')").hide('slow'); $("div#" + id + " .campaignbox-content").show('slow'); } else { $("div#" + id).animate({width: '200px', height: '184px'}, function(){ $("div#" + id + " .campaignbox-content").hide(); $(".campaignbox:not('div#" + id + "')").show(); $(".campaignbox:not('div#" + id + "')").fadeIn(); }); $("div#" + id + " div:not('.campaignbox-content')").show('slow'); } $("div#" + id).toggleClass("opened"); } </script>
<style> .character-portrait {
object-fit: cover; width: 75px; height: 150px;
} .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>


