Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I am looking for a lightweight jQuery script for tooltips that is lightweight and can be easily used with image maps... Ideally it would automatically take the 'title' of each the area tag to function as a tooltip. The reason this is an issue is I have hundreds of areas (its a world map) and a line of code for each tooltip will soon add up in file size.
qTip can do this... but its 38kb... which is more than even jQuery itself. Any recommendations?
Not sure if it's exactly what you're looking for but check out Tipsy:
http://onehackoranother.com/projects/jquery/tipsy/
9 KB uncompressed
4 KB minified
vTip might be a good candidate (see demo). It's a bit outdated, but it's dead simple and should work.
You just mark your DOM element by adding class="vtip" on it, e.g.
Tooltip test
Uncompressed JS file is only 4KB.
If you want to handle your tooltips in more dynamic way, consider creating your own simple tooltips.
I use the imaginatively-titled "jQuery Tooltip": demo here. Works well with image maps, and is easy to customize with CSS.
(Coincidentally, I tried qTip with image maps and found a weird bug when combined with the Map Hilight plugin).
PowerTip
http://stevenbenner.github.io/jquery-powertip/
PowerTip features a very flexible design that is easy to customize
Supports static tooltips as well as tooltips that follow the mouse
Ability to let users mouse on to the tooltips and interact with their content
Mouse follow tooltips are constrained to the browser viewport
Lightweight JS ~10KB, CSS ~2KB
Tipsy
http://onehackoranother.com/projects/jquery/tipsy/
It's used by Twitter, Github, Slideshare and Bitbucket, amongst others.
Lightweight JS ~10KB, CSS ~2KB
After big research none of answers to this question gave me satisfaction.
I needed one solution that is lightweight, is not abandonware as Tipsy (last update years ago, 63 bug fixing pull requests ignored by author) and I can use as typical tooltip as hint for form fields on hover, but also for dynamic field validation after form submit.
Really good one is as mentioned earlier PowerTip, but there is big issue with it: you can only have one tooltip visible at once. For me it's disqualification, I checked resources and this is basic assumption of author - only one tooltip at once, there is one single DOM object for all tooltips etc.
Tooltipster
After loosing another hour I found solution that is exactly what I needed: Tooltipster. It's really easy to implement (very similar to PowerTip) but it allows you to prepare and show many tooltips at once. Another advantage is fact of not using images at all, it's only js (~12k) and css.
Hope this will save many hours of research to someone.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am designing a website using the MEAN stack, although there are numerous tutorials guiding how to go about the development of a web application using the MEAN stack, am not sure what is the best way to add animation to your application. Specifically, should all the animation just sit in the CSS and the html templates reference those classes. What about adding advanced animation features using the HTML5 canvas, what part of the project does it sit in. What is the most generic and cleanest way to add animation to your MEAN application, is ng-Animate in Angular the way to go about it ?
EDIT: What I specifically am looking to implement is an image of a box gift wrapped in a present with a ribbon hanging on the left side of it. Now I want a little boy/girl to drag the ribbon from left to right and unwrap the present. What is the best way to do this , that fits well with the MEAN stack?
This is a very broad question. It depends entirely on what kind of animations you hope to achieve.
Nonetheless, here are a few of my favourite libraries based on experience:
AOS (Animate on Scroll) -
It is a pure CSS3 driven animation library that animates HTML elements in lots of useful ways.
Demo: http://michalsnik.github.io/aos/
Code: https://github.com/michalsnik/aos
Implementation:
You can use a package manager (npm or bower) to install for use in your project. Or download the source code directly.
Spark Scroll -
A Javascript library that also handles scroll-based animations, as well as animations based on view-port visibility. Very powerful, and can be used to do things such as: draw borders on HTML elements when scrolled into view, trigger styling changes based on viewport visibility (ie. opacity), and many other things. Also, very customizable.
Demo: http://gilbox.github.io/spark-scroll/demo/
Code: https://github.com/gilbox/spark-scroll
Implementation:
Unfortunately, there is no native Javascript implementation for this library. Using Spark Scroll requires utilizing either ReactJS (Facebook) or Angular (Google).
Last but not least,
WOW.js -
Another Javascript library that handles a lot of different animations.
Demo: http://mynameismatthieu.com/WOW/
Code: https://github.com/matthieua/WOW
Implementation: http://mynameismatthieu.com/WOW/docs.html
Honestly, I suggest you edit your post and identify what exactly you're trying to accomplish. I will update this answer after you conduct some research with the resources I've provided and determine what animations you wish to implement.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Im trying to get a sense for proper web development techniques , and im wondering if there are any habits i should be developing outside of css usage in terms of structure and layout.
What I've gotten so far is a sense that strategic and logical use of divs can help to give needed control when working with javascript and css.
But are there any other basic things i should consider that may not be aware of?
For example, I know people used to control layout with tables, but is that still a thing? Or is it now bad practice?
Looking forward to your suggestions.
Regarding your table question- People generally choose divs over tables, BUT some things cannot be done well without tables. They still have their place. Divs and Tables inset within each other are often used for datagrid styled layouts for example. Often replacing tables with divs creates a nasty (oversized) amount of css code. If you can use divs cleanly, that is perfect. If it overbloats your code, then use the simpler cleaner old faithful table code - or combine them where it makes for better results.
More info on that here: Tables instead of DIVs (Joel Coehoorn's detailed answer: "The whole "Tables vs Divs" thing just barely misses the mark. It's not "table" or "div". It's about using semantic html.")
Regarding the topic of non-CSS since your question also refers to layout design formatting:
There are some things you cannot do well also without pure CSS, that in and of itself allows modern formats to work on multiple devices. This will reach more customers.
For newer layout types for sections of pages needing icons or photos, look into the use of inline-block styled lists. CSS does wonders with them. It is a nice third alternative.
For cross-device development, you should check out responsive and fluid formatting options. A good place to start is to look at http://html5boilerplate.com/ and also http://www.initializr.com/ (boilerplate and bootstrap).
If you haven't worked with them before, look into media queries for browser sizing and device orientation displays (landscape or portrait) - part of the fundamentals in responsive web development. You can then use your regular html within the constraints you set with these.
Try to think of your pages/documents in terms of structure rather than appearance. For example, a book is made up of a title page, table of contents and chapters. Similarly, the contents of a web page can usually be broken down into logical blocks, which are then styled as required. Don't forget that web pages may be read by screen readers - your want to structure your page so the spoken output makes sense.
There has been a discussion of tables vs CSS at Why not use tables for layout in HTML?. You may also want to check out CSS Zen Garden, mentioned in that thread. Beyond this, I strongly recommend validating any HTML and CSS you write. Check out http://validator.w3.org/ for that purpose.
Divs are span are a better options for laying out a page. Tables should be used if tabular data is to be displayed.
Other than that you should mostly consider re-factoring redundant code regularly and resolve paths to directories in config files. This will help you to manage your project better. Redundant code can become a huge problem, since making changes requires changing code at several places. Make sure that you re-factor code that is being used more than once or twice into functions and call them instead.
Try diving into CSS frameworks such as bootstrap or foundation since a big community contributes there and are usually built with best practices in mind. You will be surprised to see the problems you run into have already been encountered by many others and they have found an efficient way around it too. There are frameworks and libraries for JS too. Feel free to explore.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm trying to develop a HTML/JS based "(computer) network diagram". By this I mean boxes linking to other boxes, and more importantly, boxes contained inside the bounds of other boxes.
Simplified Use Case - to explain the layout requirements
The use case is VPC (huge box) with AZ inside (2 or 3 big boxes stacked next to each other), and subnets inside each of those (boxes stacked on top of each other), and EC2s inside that (lots of small boxes next to each other).
While I've tried a number of methods (see below) I haven't found a suitable layout for my diagram and am wondering if my needs are so unique that I need to roll my own.
What I want help with...
I'm wondering if I'm missing something obvious in my research (in terms of options for a HTML5/JS solution)
Am I taking the right approach looking for a framework or are these requirements too special?
Should I consider writing my own layout (or does someone have a good idea for a good layout to start with)
Is there a framework that does visual grouping well (e.g draw a big box that contains smaller boxes, maybe a few levels deep)
My Research:
Webcola (can use with d3) http://marvl.infotech.monash.edu/webcola/
D3 http://d3js.org/
JointJS http://www.jointjs.com/demos/devs
Webcola
I originally tried Webcola as the following example seemed the most promising:
http://marvl.infotech.monash.edu/webcola/examples/smallgroups.html
I found the documentation to be lacking, a few of the links are dead, and when trying to combine the "Layout with hierarchical grouping" with "Alignment constraints with guidelines" the page failed to load.
D3.js
This appears to have lots of documentation, although I couldn't find a single example that came close to what I wanted to build.
https://github.com/mbostock/d3/wiki/Pack-Layout
Pack Layout seems the closest, with nesting used to represent the hierarchy.
The problem with this method is the size of each node is not uniform (I can just set them all to 1) and the example uses circles (this appears to be a hard rule with this layout, I think).
JointJS
http://www.jointjs.com/demos/devs
This appears to have a nice example with what appears to be a group and inputs/outputs (although the node can escape the bounds of its parent which isn't ideal.
If I did undersand your problem well, it can be done with HTML/CSS only :
the VPC div (container) is in position relative the and float left
position relative too inside an again float left with clear left if
you want to create another line
Beware of the width of the div
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Assuming that one is developing a web application which is sufficiently non-intensive that overhead is not a concern. Is it reasonable to implement CSS solely in Javascript/jQuery and completely abandon external css files?
$('<div/>').attr({'id':'special_box'}).addClass('little_box').appendTo('body')
$('<div/>').addClass('little_box').appendTo('body')
$('<div/>').addClass('little_box').appendTo('body')
...
$('.little_box').css({'color':'red'})
$('#special_box').css({'color':'blue'})
Is there anybody advocating this complete conflation? Is there anything that completely prevents it or makes it evidently unreasonable?
EDIT
The unreasonableness, as helpfully explained below, is that the jQuery css function is creating styles that are being applied to the individual element and not creating/augmenting master css rules as I'd assumed.
Although there do appear to be ways to achieve this conflation. I am not qualified to analyse them. Thanks all.
It is not reasonable, not only because it is slow (as you'd expect), any .css calls involving classes, e.g. $('.little_box').css(...), will apply css to only elements of that class that exist at the time, not .little_boxes created in the future.
why do you want to complicate yourself while development, CSS is far easy and better to use than doing css through javascript or jQuery.
Apart from being very time consuming to physically code, you CAN do this. However, it's alot more intensive than CSS and prevents alot of the advantages of CSS.
It's like building an oil rig and oil refinery to fill your car up. You could do it, but why not just go to the petrol station?
I would not advocate this complete conflation - certainly for the reasons that others have already stated, but also for these two reasons:
1) If your application grows and has multiple .js files then it will create an additional headache if you try to implement modular loading of the files using something like require.js
2) Again, if your application ever grew very large or you decided you wanted to, it would make it more work to start using Sass
As I'm sure is becoming apparent, the cons massively outweigh the (dubious) pros of this idea.
It's entirely possible to build a site that way, but it will be more work to do it, and also more work to maintain it. So, there is nothing that completely prevents it, but depending on the amount of styles it may be so much extra work that it would be unreasonable.
There is also a performance factor. CSS stands for cascading style sheets, and with such an approach you would lose both "cascading" and "sheets", left with only the style. In practice that means that you apply each style to each element instead of specifying rules that apply to multiple elements. The jQuery selectors can help you to apply the same style to multiple elements, but it will still loop through them and apply the style to each single element.
As this happens in the browser, you may get a noticable delay when the page loads. Also, the styles would be applied after all the elements are created instead of already be there when the elements come into existance, so the visitor may see the page being displayed completely without styling for a shoft while, then freeze completely while the styles are applied, before it displays correctly.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm looking for a in-browser image editing solution to integrate with my project: http://code.google.com/p/django-ray/
I got it working with Pixlr quite easily and the editor is fantastic .. however it's a hosted service, which means I must be connected to Internet for it to work ..
Is there any other solution like Pixlr but that are not hosted service ?
Updates
Editors found so far:
AIE: http://www.ajax-image-editor.com/ (feels clunkier than Gimp..)
Pixidou: http://github.com/asvinb/pixidou (no working demo found..)
And a good list of editors that are hosted: http://www.lifeclever.com/10-free-web-based-alternatives-to-photoshop/
Adobe has discontinued the creativeSDK Image Editor UI
This solution appears to no longer be viable. Sorry :(
Adobe deprecation announcement
Previous answer:
Aviary (acquired by Adobe) offers a free feature-rich on-page editor called Feather. It is hosted, however, in that you must perform a GET to retrieve the final full-size edited image. It's features include:
enhance (new): Autocorrect your photo with one of four basic enhancements.
effects (new): Choose from a variety of effects and filters for your photo.
stickers: Choose from a variety of stickers you can resize and place on your photo.
orientation (new): Rotate and flip your photo in one tool.
resize: Resize the image using width and height number fields.
crop: Crop a portion of your photo. Add presets via API. Fixed-pixel cropPresets perform a resize when applied (new).
brightness: Adjust the overall image brightness.
contrast: Adjust the overall image contrast.
saturation: Adjust the overall image saturation.
sharpness (new): Blur or sharpen the overall image in one tool.
draw: Add doodle overlays with a brush.
text: Add custom, resizable text.
redeye: Remove redeye from your photo with a brush.
whiten: Whiten teeth with a brush. (Not supported in IE7-IE8)
blemish: Remove skin blemishes with a brush.
I'm currently integrating it in a site and there are a few gotchas (they might be my fault.) I can't ever get it to perform a POST callback to my URL with the finished image URL, so instead I use the objects .onSave handler which provides the same info. Also, in current chrome/firefox, there is a security exception when Feather modifies canvas data directly from your site. So instead provide the url option (causing Feather to request the image at that URL and then provide it back to the widget on your page.)
I've just been looking at JCrop, a JQuery plugin which looks great and works beautifully - on most modern browsers, so check your target platform is supported.
You can see it in action and download the scripts from here
http://deepliquid.com/content/Jcrop.html
and you will need the JQuery script framework, available from jquery.com
It's all free and Open Source, so you can customise it as much as you like.
Rob