Joomla Indonesia

Login or Sign Up
Sign In or Register
Avatar
Not Registered Yet?

Join Now! It's FREE. Get full access and benefit from this site

Reset My password - Remind Me My username

Username
Password
Remember me
  • Page:
  • 1

TOPIC: dua variabel java script

dua variabel java script 8 years 9 months ago #176432

  • blackcloud
  • blackcloud's Avatar
  • OFFLINE
  • Pejuang Joomla
  • Posts: 111
  • Thank you received: 1
  • Karma: 2
saya ada script ini
//Document Javascript
window.addEvent('domready',function() {
	//Smooth Scroll when click on Elements on Window
	new Fx.SmoothScroll({ duration: 800 }, window); //800 milliseconds to get there
	
	//vars
	if(document.getElementById('mega_topleft') != null){
		var htopleft = document.getElementById('mega_topleft').offsetHeight;
	}else{
		var htopleft = 0;
	}
	
	if(document.getElementById('mega_logo') != null){
		var hlogo = document.getElementById('mega_logo').offsetHeight;
	}else{
		var hlogo = 0;
	}
	
	var menu = $('mega_leftmods'), offsetY = (htopleft + hlogo), offsetX = 0, speed = 500; 
	var setPosition = function(top) {
		var scroll = $(document.body).getScroll();
		if(scroll.y <= (htopleft + hlogo)){
			offsetY = (htopleft + hlogo) - scroll.y;
		}else if(scroll.y >= (htopleft + hlogo)){
			offsetY = 0;
		}
		menu.tween('top',scroll.y + offsetY);
	};
	//settings
	menu.set('tween',{ duration: speed }).setStyles({
		position: 'absolute',
		left: offsetX,
		top: offsetY,
		opacity: 1
	});
	//events
	window.addEvents({
		scroll: setPosition,
		load: setPosition
	});
});

kemudian pada bagian ini
var menu = $('mega_leftmods'), offsetY = (htopleft + hlogo), offsetX = 0, speed = 500;
saya ingin menambahkan variable baru yaitu $('mega_baru) sehingga saya berharap nanti jadi
$('mega_leftmods')+$('mega_baru)
gmn ya caranya kira kira, mohon bantuan master master.
Im Not Hacker I just Love My Computer
Last Edit: 8 years 9 months ago by blackcloud.
The administrator has disabled public write access.
  • Page:
  • 1
Moderators: alvino, ronysyz, rajasetan, KhanTry
Time to create page: 0.057 seconds

Diskusi Terakhir

  • No posts to display.

Joomla User Group Indonesia

Joomla User Group indonesia

Id-joomla.com adalah situs resmi Joomla User Group (JUG) Indonesia dan Joomla Translation Team

 
Download Terjemahan Joomla terakreditasi dari JoomlaCode dan laporkan bugs, ide dan saran nya di Sub Forum Hanacaraka

Socials

twitter id joomlafb idjoomla