Find Jobs
Hire Freelancers

jquery next image distance

$30-250 USD

Completed
Posted over 5 years ago

$30-250 USD

Paid on delivery
A coder who writes jQuery every day, this is for you. My goal is to insert a <div> automatically after any Heading (h1,h2,h3,h4), using the jQuery(':header').after( function(j) { }, and this is working. The <div> will contain an ad with a picture and a line of text, which is also working. The <div> is float:right so subsequent text flows around it, also working. My code checks the position of the current spot and the previous insertion, using [login to view URL]().top, and doesn't insert another ad <div> unless the distance is greater than 900, which is working. So far, so good. But now I want to improve this code, and NOT insert the ad <div> if there is another picture nearby. "Nearby" will mean, no subsequent picture with [login to view URL]().top less than 900 difference from current top. My problem: I'm not good with jQuery. Everything is a struggle for me. The subsequent pictures can be subsequent Siblings, or Children of the current Heading found with jQuery'(:header'). It will not be a Parent of the current Header. Your Task: create jQuery code that works inside this function: jQuery(':header').after( function(j) { } which finds the next subsequent 'img' in the DOM, sibling or any child deeper, and gets its 'top' and subtracts the current top to determine if less than 900. If one elegant jQuery can't do it, feel free to code several loops to find them, then find the nearest, then compare. This will run on webpages running Wordpress on typical modern browsers. Don't worry about editing my webpages, I can do that. You should create your own test webpage, to do the debugging and verification that it works. Your test webpage is up to you, it can be localhost or on some website hosted that you control. I will not provide a test website for you. So don't bid unless you can accomplish the testing yourself. After you provide working code, I will incorporate it, and probably ask you a few questions about things in the code that I don't understand. I prefer to work with individuals, not someone representing a team of people. Those whose team auto-responds will be ignored. You must tell me something in your reply, that indicates you read my entire proposal. I need someone to begin work immediately, and finish within 6 hours. Please tell me you can start immediately and have time to work now, not tomorrow.
Project ID: 18326033

About the project

4 proposals
Remote project
Active 5 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hi. How are you? I can start to work from just now and will do in 6 hours. I read your description just before and I think your work is very suitable for me. As you can see my profile, I can do your work with high-quality in short time. Please invite me so that we can discuss about your project on chat. thanks.
$200 USD in 3 days
5.0 (3 reviews)
3.4
3.4
4 freelancers are bidding on average $149 USD for this job
User Avatar
Dear client I have good skills about jquery and javascript If u want me ,I will show good result for u I have good review for u I have rich experience about your job I m very interesting of your job My review is very good for your project fore more detail,please contact with me I m ready on your job yet after I study I can start soon I m fullstack developer and senior developer thanks to my proposal
$155 USD in 3 days
5.0 (8 reviews)
4.2
4.2
User Avatar
Hello. I have good skills in jQuery. I have read your project description carefully and i can do your project perfectly. I hope to work with you. Thank you.
$140 USD in 2 days
5.0 (13 reviews)
4.1
4.1

About the client

Flag of CANADA
Edmonton, Canada
5.0
175
Payment method verified
Member since Dec 3, 2009

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.