Home › Forums › JavaScript › Anythingslider problem – Active page
- This topic is empty.
-
AuthorPosts
-
December 5, 2011 at 10:17 am #35476quantum4Member
Hi all,
i hope this thread is in the right place. I used Anythingslider for this website: http://www.barnez.dds.nl/yooom/
Trying to figure out how to get the Active page link yellow. Hovering the menu-links works fine, but Active doesn’t until now. What am i missing??? Or isn’t it possible at all in this way.
The Javascript is confusing me…
Thanks a lot !
PaulDecember 5, 2011 at 10:28 am #91912MottieMemberHi Quantum4!
LMAO I love the comment in your slider initialization code. Basically you’ll need to add this css
#externalNav.current {
color: #F8B334;
}and this code to the slider initialization code:
$('#slider').anythingSlider({
theme : 'cs-portfolio',
easing : 'linear',
buildNavigation : false,
buildStartStop : false,
onSlideInit: function(e, slider) {
$('#externalNav').find('a')
.removeClass('current')
.eq(slider.currentPage - 1).addClass('current');
},
// (swipe for ifags)
clickForwardArrow: "click",
clickBackArrow: "click",
clickControls: "click focusin",
resumeOnVideoEnd: true,
addWmodeToObject: "opaque"
});
And the last comma after “opaque” needs to be removed or IE will hissy fit.
December 5, 2011 at 1:50 pm #91930quantum4Memberlol Mottie,
Glad to see you have great sense of humor!
Thanks for your superfast reply, i changed the code, but unfortunately the active link doesn’t want to turn yellowish yet.We might have to redo the whole navigationbar though, with separate rollover background images, since i just heard that the “rings” have to darken when active. Is that somewhere in an example, or do you have some ready made code for this perhaps ?
Grts, Paul
December 5, 2011 at 8:41 pm #91957MottieMemberHey again!
If you look at this main wiki document page, you’ll see Demos, then a sub-category of Navigation demos. Check out the first two: “Custom, External navigation controls” and “Moving navigation controls”. Maybe that will help get you started.
December 6, 2011 at 7:14 am #91980quantum4MemberHello Mottie,
guess it has become a Javascript/CSS problem now..
I managed to get the images in. Made 2 versions of the images, one series with white text and one series with yellow text, all to be found in the directory images/navbar: (called bottom-01-white.png etc. and bottom-01-yellow.png etc.)My question is: how do i get the yellow image to be shown on the active page.
Hope you can help out, it’s highly appreciated and we are thinking of sending you beers :)Thanks again, Paul
December 6, 2011 at 9:03 am #91987MottieMemberHi Paul!
Like I posted above, you should be able to just use the “onSlideInit” callback to find and add a class name to the navigation link. When you have the new code in place, I can give you an example.
December 6, 2011 at 10:14 am #91990quantum4MemberMottie,
Do you mean like this:
// Set up Sliders
// **************
$(function(){
$('#slider').anythingSlider({
theme : 'cs-portfolio',
easing : 'linear',
buildNavigation : false,
buildStartStop : false,
onSlideInit: function(e, slider) {
$('#externalNav').find('a')
.removeClass('current')
.eq(slider.currentPage - 1).addClass('current');
},
// (swipe for ifags)
clickForwardArrow: "click",
clickBackArrow: "click",
clickControls: "click focusin",
resumeOnVideoEnd: true,
addWmodeToObject: "opaque",
});
});December 6, 2011 at 10:42 am #91991MottieMemberWell yes, but I meant with the circle images different border colors and yellow text in place. All you should need to do now is include the “current” class with the “#externalNav a:hover” to make the images highlight in both situations.
December 6, 2011 at 11:49 am #91994quantum4MemberOnce again thanks for your quick reply !
I made new images, top part is the circle with white text, bottom part circle with yellow text, that’s what you meant right … so the hover will perform a background image-shift so to say…
Problem now is that i cannot get them into place in the externalNav…
It’s a new riddle every time… ;CSS – gotta love it
December 6, 2011 at 1:11 pm #92006MottieMemberTry this method…
CSS
#externalNav img {
float: left;
}
#externalNav a {
float: left;
width : 60px;
height : 88px;
overflow: hidden;
}
#externalNav a span {
text-indent: -9999em;
display: block;
}
.tab-why { background-image: url(../images/navbar/bottom-01-white.png); }
.tab-health { background-image: url(../images/navbar/bottom-02-white.png); }
.tab-family { background-image: url(../images/navbar/bottom-03-white.png); }
.tab-how { background-image: url(../images/navbar/bottom-04-white.png); }
.tab-profs { background-image: url(../images/navbar/bottom-05-white.png); }
.tab-join { background-image: url(../images/navbar/bottom-06-white.png); }
.tab-about { background-image: url(../images/navbar/bottom-07-white.png); }
.tab-why.current, .tab-why:hover { background-image: url(../images/navbar/bottom-01-yellow.png); }
.tab-health.current, .tab-health:hover { background-image: url(../images/navbar/bottom-02-yellow.png); }
.tab-family.current, .tab-family:hover { background-image: url(../images/navbar/bottom-03-yellow.png); }
.tab-how.current, .tab-how:hover { background-image: url(../images/navbar/bottom-04-yellow.png); }
.tab-profs.current, .tab-profs:hover { background-image: url(../images/navbar/bottom-05-yellow.png); }
.tab-join.current, .tab-join:hover { background-image: url(../images/navbar/bottom-06-yellow.png); }
.tab-about.current, .tab-about:hover { background-image: url(../images/navbar/bottom-07-yellow.png); }
.clear { clear: both; }and change the HTML to this:
It would be even better if you made an image sprite with all of the images combined.
December 6, 2011 at 1:19 pm #92007quantum4MemberThanks so much Mottie!
Will have check later though, have to go to a Joomla meeting now.
I will let you know how it went.
Regards, Paul
December 6, 2011 at 4:54 pm #92031quantum4MemberHi Mottie,
just came back from the meeting, couldn’t wait to check your code :)
Anyhow, i changed it, fixed some crooked pictures and upped it in the usual place. It’s almost ok, except for the fact that the current state goes to the wrong place. And when entering the site, WHY isn’t active yet.Is that the Javascript or something in the CSS perhaps.
Paul
December 6, 2011 at 11:13 pm #92065MottieMemberOops, change the AnythingSlider initialization code to this:
$('#slider').anythingSlider({
theme : 'cs-portfolio',
easing : 'linear',
buildNavigation : false,
buildStartStop : false,
onInitialized: function(e, slider) {
$('#externalNav')
.find('a').eq(slider.currentPage - 1).addClass('current');
},
onSlideInit: function(e, slider) {
$('#externalNav').find('a')
.removeClass('current')
.eq(slider.targetPage - 1).addClass('current');
},
// (swipe for ifags)
clickForwardArrow: "click",
clickBackArrow: "click",
clickControls: "click focusin",
resumeOnVideoEnd: true,
addWmodeToObject: "opaque"
});December 7, 2011 at 2:42 am #92080quantum4Memberhehe, you are human after all… ;)
Thanks for the patience and the enormous amount of help Mottie !
Paul
-
AuthorPosts
- The forum ‘JavaScript’ is closed to new topics and replies.