Tagged Questions
2
votes
1answer
28 views
Jquery File Tree Toggle - Code Efficiency
I am making a web app that will have a "my files" area and to do so I am writing my own html and jQuery to control the opening and closing of each folder (or ul li). I want to make sure that this web ...
1
vote
1answer
42 views
Using .hover recommended?
Is there a better way to write the JS for this? I'm asking because I read from somewhere that using .hover isn't recommended. Also, if I move the mouse in and out of the box really fast, the box fades ...
2
votes
0answers
111 views
Display progress bar to show async. request status using JQuery
Instead of using ProgressBar plugin, I've below script to display the progress bar for async. requests on the page. Could anyone provide any feedback on this esp. if there will be any issues like ...
0
votes
0answers
53 views
How does Facebook toggle its notification center icons to display the respective DIVs with the notifications when clicked? [closed]
How does Facebook toggle its notification center icons to display the respective DIVs with the notifications when clicked?
All of you have at-least interacted with the Facebook notifications center ...
1
vote
1answer
62 views
How can this be done in the shortest way?
I have saved the class holding the position of the i element in the a tag that is clicked by the user. When the a tag is clicked, I want to get the value of its attr and add it as a class to the i ...
2
votes
1answer
49 views
Convert javascript to css media query?
I'm running into page performace issues and I believe this block is causing the biggest slowdown:
// Section menu on mouseover, hide menu on mouseout
// Can be more concise using .toggleClass?
...
1
vote
0answers
60 views
JQuery Drag Div Code Simplification
My code allows for the user to move a div around a container div by clicking and dragging the top, much like a window on a desktop. It does this by waiting for mousedown then mousemove, getting ...
-1
votes
1answer
53 views
Trouble with jquery show and hide [closed]
I'm having a ton of trouble trying to get simple jquery functionality to work. All I want is to be able to click on a menu button and have a menu pop up and click outside of it to close it. I think ...
2
votes
1answer
70 views
I've embedded several PHP/HTML/Javascript in one page. How can I improve on the efficiency/performance?
Just a quick preface, I'm not a web developer. I'm simply doing this as a favor for a friend. My goal is to be done with it as quickly as possible, but still not have the coding be horrendous. With ...
0
votes
1answer
44 views
FadeIn a div element with jquery
I am new to web developtment and I want to Fadein a div using jquery. I used the following jquery code to fadein my div. It is not working, what am I doing wrong?
html
<body>
<div ...
3
votes
1answer
235 views
Improving Twitter Bootstrap Tooltips with json data
This is a working example that I am trying to improve.
Throughout the application I am working on one of the requirements was to have tooltips everywhere. However the customer wanted the ability to ...
4
votes
2answers
241 views
Simplifying Code for Drop-Down-Box in JQuery and HTML
I'm trying to come up with a way to make a drop down box that is displayed through a jquery mouse hover event and with nested dropdown boxes displayed through hovering over elements of the original ...
4
votes
1answer
479 views
DIV mask implemented in JavaScript/CSS
Mask.html
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script type="text/javascript" ...
2
votes
3answers
272 views
Tidying and optimising code
I have the following code in jsfiddle. I have been told this this code is messy and not optimised. My question is, what about this is messy and unoptimised and how can it be tidied up and optimised ...
2
votes
0answers
102 views
Rendering hidden element from view in Rails, HAML
Simple example, I need to render div with some text hidden by default. I'll do something like:
= link_to 'Display text', '#'
.div_with_text{ style: 'display: none;' }
= 'Some text!'
And after ...
1
vote
1answer
102 views
optimise jquery code
I have written a jquery code for a pop up but the problem is I wanted to optimize the jquery code can you tell me how to optimise it to have a better results in the browser..
it would be great if u ...
2
votes
2answers
1k views
Toggleclass best practice (JQuery and CSS syntax)
I've created this fiddle: http://jsfiddle.net/9SXLJ/ to demonstrate something I've been working on. I've been trying to mimic the behaviour of Twitter where a tweet is expanded, the border-radius and ...
3
votes
1answer
131 views
How to improve this JavaScript implementation of a TODO manager?
I was asked to create a TODO manager using JavaScript and CSS.
I did not get a good review on the code nor specific comments on how to improve it.
My implementation:
<html>
<head>
...
1
vote
3answers
228 views
jQuery substitute for multiple hovers
I would like to find a more efficienct way to use jQuery for my question and answer page.
Here is the code which I want to change. If a .q_container is clicked, I want its corresponding answer div ...
3
votes
2answers
228 views
Creating Custom Jquery Slider
Can someone please help to rewrite / tidy up this?
// News Article Slideshow
var periodToChangeSlide = 5000;
var pp_slideshow = undefined;
var currentPage = 0;
$('#news-feature-img-wrap ...
2
votes
2answers
280 views
Review my Javascript for structure and best-practices
I am trying to use jQuery to make calculations with a table containing football data. Can I improve what I have done here? Is my code well-structured and executed, or does it need improvements?
If my ...
-1
votes
6answers
131 views
jQuery doing what it's suppose to on all the pages except one! [closed]
Here is my script: http://jsfiddle.net/9cnGC/11/
I was wondering if anyone can help me with this fiddle and maybe clean it up a bit so it can run more efficiently?
I believe it is because there is ...
3
votes
1answer
2k views
Custom dropdown menu using jQuery
I have written a custom drop down menu handler using jQuery because I felt that the native drop down didn't fit my UI.
I have taking into consideration the native way of going through a drop down box ...
3
votes
2answers
478 views
HTML/CSS/jQuery - Code Review
I've been using CSS and HTML for a while and I'm trying to start to use better methods of coding.
I've tried my best not to hack anything, etc etc so I wondered if anyone could let me know how I'm ...
2
votes
2answers
225 views
Am I using jquery correctly in my first simple project?
Please review my first query project, it achieves the desired result, but am I doing it right?
window.onresize = centreBoxInViewport;
function displayLightBox(obj) {
// Get the path to the ...
1
vote
3answers
5k views
Adding fade to jquery background position animate
I've just implemented a background animate on some social media icons where the image goes grey to color on :hover.
I wanted to know if there's firstly a better way to write the following but also ...
3
votes
3answers
107 views
jQuery code improvement
I wrote this code using jQuery, but I think it can be improved. Can you guys give me some feedback?
var $i = 1,
totalImg = $('.home-featured-bg .absolute div').length,
$theWidth = ...
3
votes
1answer
245 views
Can my code be optimized more?
Preview: http://sparksonrails.pennfolio.com/
Jquery:
function introIconFirst()
{
$('h2.ribbon').css(
{
'marginTop': '+30px',
'opacity': '0'
}).animate(
{
...
3
votes
3answers
122 views
Beginner jQuery – Coding Fundamentals / Performance
Empty Textboxes, class="loc" display "(City, State \ Country)" using italics and silver. Of course, Textboxes that do have data are displayed according to page defaults.
I noticed chaining and ...
0
votes
1answer
267 views
Javascript to compute max width and height for a nested HTML element
I wrote the following code to give an HTML element max width/height in its parent container.
I think I address the box model issues but I am wondering if anyone can see issues and or shortcomings.
...
2
votes
4answers
388 views
Simple Javascript Widget without cluttering global namespace?
I've written some Javascript code with jQuery to display a dialog box on a web page that "floats" in the corder of the page.
(1) It has the following features: the dialog follows as the user scrolls ...
5
votes
1answer
105 views
Is this a reasonable way of doing javascript navigation UI?
I think that the slice() is a bit hacky, and prone to breaking if I change my mind about the id names, but I wanted this to be generic so I could add types easily
Is there maybe another / better way ...
2
votes
1answer
425 views
Possibly optimize my Jquery code?
I am creating a tab plugin. I want to know if there is a better way of doing this or if what I have is good. It works just fine, but there may be some shortcuts or a more optimized way of ...
8
votes
4answers
846 views
Any tips on making this JS better?
Working on a personal project to keep different snippets/examples/small projects of mine organized. I want to make the most of my page width, so I decided to write a navigation menu that slides out. ...