Comments (8)
The main reason for not using box-sizing: border-box;
is that it doesn't work on older browsers (like IE6/7) that the script was designed to support. But now that you bring the topic, I agree that it's not worth the trouble any more to support such extinct browsers nowadays. I started working on the script more than 2 years ago when IE7 was still considered worth supporting by some users (and actually, it still is by some users on restricted intranets). So I guess I can switch to border-box
in some of the next releases and simplify a bit the JS code too.
But in general, you should be very careful when applying custom styles to the LI's. Normally we only apply the most basic layout rules for them in the core CSS (i.e. to set the main menu items' arrangement to horizontal, vertical, rtl, etc.) and to style the items users are encouraged to work with the A's.
from smartmenus.
Those browsers are obsolete. When google dropped support for them I believe that it's safe for you to do it also.
I've had a request from the client to enable the skinning of the menus dynamically. And I've started experimenting with that.
I've built an interface for skinning (border, padding etc..)
If you look at the video, you will see what I mean. Interface is on the left (not shown)
I've loaded core css
and added classes to display submenus all the time while editing.
I have a little code that re-positions the menus when new properties are applied. The code is supper simple, it calculates the border
padding
and margin
of the parent, and offsets the submenu accordingly.
However when I load the new design and fire up smartmenus, it's not calculating them correctly (smart menus are not active in the video)
video
Do you have any idea how can I solve this?
Or I'll just have to limit what can be customized.
from smartmenus.
Also I would like to try to modify the positioning code, but it seems that it has a lot of moving parts.
I see that you have getOffset
method, is that the only place where the layout is calculated?
Will it be enough to try to overwrite that particular function?
edit: sidenote: after further inspecting the code , I see that support for IE6,7,8 adds a lot complexity.
from smartmenus.
Unfortunately, I don't have a clear idea what your code does and how exactly it does it so I am not able to help you out without being familiar with it. getOffset
is a generic helper to calculate the dimensions of an element. It's used on various placed in the code. Not sure how and if it could help you if you try to modify it. The sub menus positioning code is in menuPosition
but I am again not sure if it could be of any help to you.
from smartmenus.
Basically I would like for the submenus to work with different border widths , padding's, and line height for buttons. I'm trying to find a way to properly calculate the positioning of the submenus.
I'll investigate this further.
from smartmenus.
Not sure but I guess this could help - when you update some of the properties (border, padding, etc.) you can call the following to recalculate the sub menus's position:
var obj = $('#main-menu').data('smartmenus');
// recalc all sub menus' position
$.each(obj.subMenus, function() {
obj.menuPosition(this);
});
from smartmenus.
I've moved away from the script for my current project, but I'll keep this in mind for the next one. Excellent work, however my recommendation would be to drop the support for those very old browsers, or to make two branches for the project.
Keep up the good work.
from smartmenus.
Thanks for the feedback! I am already planning on removing all IE tweaks and probably switching to box-sizing:border-box;
(the switch is actually a trivial task, I'm just still not 100% convinced it's needed). But even without the IE tweaks, the menus remain usable in IE6+ (though with some layout issues) so those are definitely going in the next release..
from smartmenus.
Related Issues (20)
- Cannot create property 'guid' on string '.dropdown-menu.show' HOT 6
- menu toggle button not accessible (enough) HOT 4
- smartmenus with "Content-Security-Policy" HOT 6
- Menu Z Index question. HOT 2
- Google SEO 2022: Complete SEO Beginner's Guide
- Pay Per Click vs. Search Engine Optimization
- On-Page vs Off-Page SEO: What's the Difference?
- please add new tag
- A11y: menu toggle button needs a :focus halo HOT 2
- A11y: ESC key should dismiss expanded menu HOT 1
- Second click on link not functional on Bootstrap 5 HOT 1
- A11y: submenus should not open/close on focus HOT 2
- A11y: replace span subIndicator with button HOT 2
- eval of user controlled data? HOT 6
- please add support bootsrap 5 HOT 8
- fix warning
- A11y: add role="button" to span subIndicator HOT 1
- a11y: move the <span> subindicator outside the menu link anchor tag
- [A11Y] aria-current on active menu item HOT 1
- SmartMenus should log errors to console, not use `alert()` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smartmenus.