Widget:PhotoTabs: Difference between revisions
From Unforgotten Realms Wiki
Jump to navigationJump to search
imported>Pillowkeeper Undo revision 38127 by Pillowkeeper (talk) |
imported>Pillowkeeper mNo edit summary |
||
| Line 9: | Line 9: | ||
.button { | .button { | ||
color: white; | color: white; | ||
border | border: 1px solid #64320d; | ||
background-color: #b36e14; | |||
background-color: # | |||
font-family: "Arial"; | font-family: "Arial"; | ||
letter-spacing: .5px; | letter-spacing: .5px; | ||
| Line 27: | Line 25: | ||
<script> | <script> | ||
if($(".button").length == 0) { | if($(".button").length == 0) { | ||
var series = []; | var series = []; | ||
| Line 60: | Line 57: | ||
document.getElementById("pic").height = series[0].height; | document.getElementById("pic").height = series[0].height; | ||
document.getElementById(series[0].name).style.backgroundColor = "# | document.getElementById(series[0].name).style.backgroundColor = "#89540F"; | ||
} | } | ||
} | } | ||
| Line 66: | Line 63: | ||
function change(id) { | function change(id) { | ||
for (i = 0; i < series.length; i++) { | for (i = 0; i < series.length; i++) { | ||
document.getElementById(series[i].name).style.backgroundColor = "# | document.getElementById(series[i].name).style.backgroundColor = "#b36e14"; //saddle | ||
} | } | ||
document.getElementById(id).style.backgroundColor = "# | document.getElementById(id).style.backgroundColor = "#89540F"; //darker | ||
for (i = 0; i < series.length; i++) { | for (i = 0; i < series.length; i++) { | ||
if (series[i].name == id) { | if (series[i].name == id) { | ||
Revision as of 06:01, 22 April 2017
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.0.min.js"></script>
<img id="pic" align="middle"> <style>
.button {
color: white;
border: 1px solid #64320d;
background-color: #b36e14;
font-family: "Arial";
letter-spacing: .5px;
padding: 5px;
text-align: center;
}
.p {
margin: 11px;
}
</style>
<script> if($(".button").length == 0) {
var series = [];
var obj = {};
obj["name"] = "";
obj["source"] = "";
obj["width"] = "";
obj["height"] = "";
series.push(obj);
console.log(series);
var count = 0;
for (i = 0; i < series.length; i++) {
count = count + series[i].name.length;
if (count > 25) {
count = 0;
$('#tabs').append('
');
}
$('#tabs').append('<a class="button" onclick="change(id)" id="' + series[i].name + '" ">' + series[i].name + '</a>');
if (i == 0) {
document.getElementById("pic").src = series[0].source;
document.getElementById("pic").width = series[0].width;
document.getElementById("pic").height = series[0].height;
document.getElementById(series[0].name).style.backgroundColor = "#89540F"; } }
function change(id) {
for (i = 0; i < series.length; i++) {
document.getElementById(series[i].name).style.backgroundColor = "#b36e14"; //saddle
}
document.getElementById(id).style.backgroundColor = "#89540F"; //darker
for (i = 0; i < series.length; i++) {
if (series[i].name == id) {
document.getElementById("pic").src = series[i].source;
document.getElementById("pic").width = series[i].width;
document.getElementById("pic").height = series[i].height;
};
}
}
} </script>


