Support Forum

Please note that this forum is only available to you in read only mode. In order to contribute to this conversation you will need to renew your subscription.

Slide show "margin-top"

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Hi Guys

I've started playing around with this template and framework, which I am loving by the way, but the slideshow is getting an element style margin-top: -106px;


medicaBanner.jpg



Where is this value being generated from?

I though it may have been the banner.php block.

Basically I have made the header/nav bar a solid colour a I would like to drop the slideshow down a bit so it is not covered by the header/nav bar.

Cheers
  • Chris French's Avatar
  • Chris French
  • 12 Month Developer
  • 68 posts
  • Karma: 0
The administrator has disabled public write access.
Hi Chris,
So glad you like it.
Thats generated from javascript in the js/scripts.js file.

Just remove this code:
// Banner offset
	 	var offset = $('#topwrap').outerHeight() + $('#navwrap').outerHeight();
	 	$('#bannerwrap').css({'margin-top': '-'+ offset + 'px'});
	 	
	 	$(window).bind("debouncedresize",function(){
	 	
	 		// Banner offset
	 		var offset = $('#topwrap').outerHeight() + $('#navwrap').outerHeight();
	 		$('#bannerwrap').css({'margin-top': '-'+ offset + 'px'});
 	
	 	});

And then compress js in the settings panel if you are loading the compressed file.

Thanks
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
The following user(s) said Thank You: Chris French
Thanks Anthony, that is the quickest reply I have ever had on a joomla template forum.
  • Chris French's Avatar
  • Chris French
  • 12 Month Developer
  • 68 posts
  • Karma: 0
The administrator has disabled public write access.
:)

Good luck with the site

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Hi Paul/Anthony

I Just noticed something weird, deleting the code you suggested works, but as soon as you scroll down the page, the margin-top style reappears.

I noticed this script being loaded at the bottom of the page
jQuery(document).ready(function($){
	
	var win      = $(window),
	    fxel     = $('#navwrap'),
	    fill     = $('#sticky-fill'),
	    navheight = $('#navwrap').outerHeight(),
	    topheight = $('#topwrap').outerHeight(),
	    eloffset = fxel.offset().top;
	   
	   	
	    	
	 console.log(navheight);
 	$(fill).height(navheight);

	win.scroll(function() {
	    if (eloffset < win.scrollTop()) {
	        fxel.addClass("fixed");
	        $('html').addClass("fixed");
	        $('#bannerwrap').css({'margin-top': '-'+ (navheight - 30) + 'px'});
	        
	    } else {
	        fxel.removeClass("fixed");
	        $('html').removeClass("fixed");
	        $('#bannerwrap').css({'margin-top': '-'+ (topheight + navheight) + 'px'});
	    }
	});
});

Could this be causing the problem?

Have a look at the site atthis link
  • Chris French's Avatar
  • Chris French
  • 12 Month Developer
  • 68 posts
  • Karma: 0
The administrator has disabled public write access.
Hi Guys

I found it in scripts.php.

I removed the margin-top from the script and it seems to be holding.

Is there a way to change this that wont be affected during a template update?
  • Chris French's Avatar
  • Chris French
  • 12 Month Developer
  • 68 posts
  • Karma: 0
Last Edit: 8 years 5 months ago by Chris French. Reason: Added a question
The administrator has disabled public write access.
Hi Chris,

Gone from the fastest to the slowest :)

Sorry for the delay.

Unfortunately there is no way to prevent this from happening. If a file is included in a Joomla package when it is installed through the template manager then any changes made to that file will be overridden.

So if it's just one file then it's best to install the zip then reinstate the changed file from a backup.

Hope that helps.
Anthony
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
The following user(s) said Thank You: Chris French

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers