- Posts: 2
- Thank you received: 0
java script smooth12.js
- clarck connect
-
Topic Author
- Offline
- Fresh Boarder
-
Less
More
12 years 10 months ago #1585
by clarck connect
java script smooth12.js was created by clarck connect
hello everyone i want ask some question abotu this template,
i have make new module in top and also i want it move like left side always follow page, i found it in java script. here is the code :
and after that i find this one :
.
i want add new var menu ex. var menu = $('mega_new') so it will be
.
how can i do this.
thanks before and this great template.
i have make new module in top and also i want it move like left side always follow page, i found it in java script. here is the code :
Code:
//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
});
});
Code:
var menu = $('mega_leftmods'), offsetY = (htopleft + hlogo), offsetX = 0, speed = 500;
i want add new var menu ex. var menu = $('mega_new') so it will be
Code:
var menu = $('mega_new')+var menu = $('mega_leftmods'
how can i do this.
thanks before and this great template.
Please Log in or Create an account to join the conversation.
- Linh Robert
-
- Offline
- Banned
-
Less
More
- Posts: 908
- Thank you received: 568
12 years 10 months ago #1587
by Linh Robert
If you need to send us FTP access / host access, administrator access or any private information:
services(at)omegatheme(dot)com or drop a ticket www.omegatheme.com/member/
Replied by Linh Robert on topic Re: java script smooth12.js
It may look like this:
- Add class for your new menu, eg: "myclass". Also add this class for current menu.
- You saw this:
Now instead of get the element by id ("mega_leftmods"), you can get elements by class ("myclass"). So you can apply for more than 1 menu.
That's the idea, certainly you may need work more after that.
Thanks
- Add class for your new menu, eg: "myclass". Also add this class for current menu.
- You saw this:
Code:
var menu = $('mega_leftmods'), offsetY = (htopleft + hlogo), offsetX = 0, speed = 500;
Now instead of get the element by id ("mega_leftmods"), you can get elements by class ("myclass"). So you can apply for more than 1 menu.
That's the idea, certainly you may need work more after that.
Thanks
If you need to send us FTP access / host access, administrator access or any private information:
services(at)omegatheme(dot)com or drop a ticket www.omegatheme.com/member/
Please Log in or Create an account to join the conversation.
- clarck connect
-
Topic Author
- Offline
- Fresh Boarder
-
Less
More
- Posts: 2
- Thank you received: 0
12 years 10 months ago #1589
by clarck connect
Replied by clarck connect on topic Re: java script smooth12.js
ok thanks ill try that one
Please Log in or Create an account to join the conversation.
Time to create page: 0.186 seconds