<link rel="stylesheet" type="text/css" href="/css/bootstrap-tour-standalone.min.css" />
(...)
<script type="text/javascript" src="/js/bootstrap-tour-standalone.min.js"></script>
<script>
// Instance the tour
var tour = new Tour({
steps: [
{
element: "#stepOne",
title: "Krok 1",
content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
},
{
element: "#stepTwo",
title: "Krok 2",
content: "Proin blandit, tortor quis elementum faucibus, lorem erat rutrum nisi, at congue sapien libero at lectus. "
},
{
element: "#stepThree",
title: "Krok 3",
content: "Proin blandit, tortor quis elementum faucibus, lorem erat rutrum nisi, at congue sapien libero at lectus. ",
placement: "bottom"
}
]});
// Initialize the tour
tour.init();
// Start the tour
tour.start();
</script>
Chcialem zrobic tutorial z wykorzystaniem Bootstrap tour (http://bootstraptour.com/) w koncu wszystko dobrze podpialem ale pojawil sie problem. Skrypt usilnie wyswietla wszystko od konca. Kombinowalem z next i prev z dokumentacji, ale najlepsze co mi sie udalo uzyskac to pokazywanie 0 - 1 - 2 z tym ze odwrocilo sie dzialanie przyciskow. Na 1 kroku byl aktywny prev zamiast next, wiec nie specjalnie mnie to urzadza. Sprawdzalem IDki jakie sa nadawane poszczegolnym krokom i jest to odpowiednio id=0 / 1 / 2, wiec nie wiem gdzie lezy problem. Czy korzystal ktos moze z tego?
Okazało się, że jest to bug. Rozwiazanie zamieszczam poniżej:
$(function() {
var tour = new Tour({
storage: false, /* Tutaj byl problem */
steps: [
{
element: "#stepOne",
title: "Krok 1/3",
content: "I put it first in the list of steps, I wonder why it shows second.",
animation: true
},
{
element: "#stepTwo",
title: "Krok 2/3",
content: "It's second in the list of steps, and the prev/next buttons work in the right order",
animation: true
},
{
element: "#stepThree",
title: "Krok 3/3",
content: "It's second in the list of steps, and the prev/next buttons work in the right order",
animation: true
p
}
]
}).init().start(true);
});
</script>
Wybaczcie za temat, ale zawsze jak szukam kilka godzin rozwiazania i w koncu napisze tutaj o pomoc, to w magiczny sposob znajduje je stam.