Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
i'm upgrading my D6 theme to D7 and i use a custom JS code to do dynamic anchor.in D6 i put my code in a JS file include in the theme via the .info file.And paste html code into tpl file.
I do the same in D7 but doesn't work..can you tell me why please ? thanks
//Pour avoir un retour haut dynamique selon longueur du contenu
/*
*Utiliser dans le html cette ancre:
*
*
Haut de page
*
**/
Drupal.behaviors.goTop = function(context) {
var link = $('#retour_haut', context);
$(window).scroll(function(){
if ($(window).scrollTop() >= 250) { // Si la page est descendue de 250px.
link.fadeIn(500); // On fait un fadeIn pendant 500ms.
} else {
link.fadeOut(500); // On est au dessus de 250 donc fadeOut pendant 500ms.
}
});
link.click(function(e) {
e.preventDefault; // Lors d'un click on empêche le navigateur de rafraichir
//$.scrollTo(400); // Et on va en haut de page.
$('html,body').animate({scrollTop:0},'slow');
});
}
//Pour avoir un scroll smooth. http://www.learningjquery.com/2007/08/animated-scrolling-for-same-page-links
$(document).ready(function() {
$('a[href*=#]').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
I'm doing some theming (Omega sub-theme) and I've discovered that when you call the main menu in a block the "active" class only gets applied to the li a and not the li, but the menu that's already displayed by default does have this class applied to the li. Does anyone know why that is and how I can apply the active class to the li in a Block menu so I can style the active li? Thanks.
I'm using Display Suite to manage my images on a new content type. I had to hardcode into the system the following CSS in order to keep the image inside the box on the full nodes:
how can i make certain pages look like just pages with out the blog style with comment box and all that add article stuff
i just want some simple pages like home, about, contact, etc
blog is still ok just that i want to use it in a blog only area so on the menu it can say something like home, about , contact, blog(or maybe updates, new content, features or whatever but still blog style)
i still want to be able to update the home page and the other pages to edit them ... is this possible?