jQuery - jQuery-related news, articles, plugins and tutorials
2008.04.09 12:14 jQuery - jQuery-related news, articles, plugins and tutorials
News, articles, plugins and tutorials for jQuery, the world's most popular Javascript library! Covering jQuery Core, jQuery UI, jQuery Mobile, and other related projects.
2024.05.16 00:58 57BearColumns are creating horizontal scrollbar
I have a container div with a row div inside it and everything is fine until I add a col div inside the row. Actually, as long as I have no content in the col div everything is still fine. But when I add anything, even 1 character, to the col div, I get horizontal scrolling. My code is basic. I tested this on a simple layout with nothing else except the skeleton code.
2024.05.08 04:13 Embarrassed-Tank-663Vertical sidebar navigation problem
Hello good Django HTMX friends! I hope i can get some help on this issue. Here is the image first https://preview.redd.it/p4uqrapx34zc1.png?width=1920&format=png&auto=webp&s=ac8812b189a657133c28f8fbd245075fd2b20d2c So on the left we have all course modules and lessons listed, that lead to lesson.get_absolute_url. But when there are more lessons, you have to scroll this sidebar vertically in order to see all lesson links. So you click on one link, the lesson page is loaded but the sidebar also comes back to top. So if you clicked on a lesson deep down, you don't see that link in the viewport anymore. I tried hx-boost="true" it works to load the lesson with no page refresh, but the sidebar gets scrolled to top, i thought it will solve the problem but it didn't. Here is the aside code
include sidebar to lesson and test pages {% include "courses/backend/lessons/includes/aside.html" %} include one header to lesson and test pages {% include "courses/backend/lessons/includes/main-top.html" %}
in block content we include divs with dynamic content for lessons and tests {% block content %}{% endblock content %}
div class="main-content"
div class="wrap" htmx local htmx csrf
Needed behavior is shown here https://v2.tailwindcss.com/docs/ (this is just a good example) scroll in the sidebar and click on any link, you will see that the content loads but the sidebar doesn't get scrolled back to top. I hope somebody can help me, thank you very much :)
2024.05.06 20:50 Dylan-h3Local server crashes when ever I run my flask web app
Hello, I'm new to coding and I'm following a tutorial on how to make a fake news detecting algorithm and hosting it on a server. So far the algorithm works fine, I have the basic UI done, and the local server boots up normally. However, if I try to submit any text I get "internal server error". I'm only a beginner but it seems like the "Predict" button may be the culprit? From the dev tools in google it looks like the program is not posting to the right location? Any guidance will be greatly appreciated the index and app files will be pasted below. If there's any other important information I need to share please let me know. Thank you!
Fake News Prediction
A fake news prediction web application using Machine Learning algorithms, deployed using Django and Heroku.
Enter your text to try it.
{% if result %}
Prediction : {{result}} {% endif %} app = Flask(__name__) ps = PorterStemmer() # Load model and vectorizer model = pickle.load(open('model2.pkl', 'rb')) tfidfvect = pickle.load(open('tfidfvect2.pkl', 'rb')) # Build functionalities @app.route('/', methods=['GET']) def home(): return render_template('index.html') def predict(text): review = re.sub('[^a-zA-Z]', ' ', text) review = review.lower() review = review.split() review = [ps.stem(word) for word in review if not word in stopwords.words('english')] review = ' '.join(review) review_vect = tfidfvect.transform([review]).toarray() prediction = 'FAKE' if model.predict(review_vect) == 0 else 'REAL' return prediction @app.route('/', methods=['POST']) def webapp(): text = request.form['text'] prediction = predict(text) return render_template('index.html', text=text, result=prediction) @app.route('/predict/', methods=['GET','POST']) def api(): text = request.args.get("text") prediction = predict(text) return jsonify(prediction=prediction) if __name__ == "__main__": app.run()
2024.05.01 16:22 Traditional-Seat9437How can I get the current scroll position relative to the top of the page?
I've been searching for a solution to this, but nothing seems to do what I need. All I want is for a value to be returned that is the current number of pixels the user is scrolling from the top of the screen. In jQuery I would do it like so: `if ($(window).scrollTop() > 100 ){ // do something } else { // do something else }; $(window).scroll(function() { navScroll(); });` Is there an easy way in Vue (or Nuxt) to know when the user is at least N pixels away from the top of the screen?
2024.04.25 16:48 AlmightyScoutNeed help with my final project
Hello respectable CS50 community. Would appreciate if somebody could spot an error in my code. My final project is a web-application, UI in some way is similar to Finance PS. I continued using Bootstrap lib since Finance and I am using Bootstrap carousel for images in particular. I want images to be fullscreen so there would be only navbar and images changing each other (as a starting screen). But for some reason I have white borders around images. I applied multiple CSS styles, used different images with different resolutions, tried starting the app with different resolution, asked CS50 AI and watched multiple guides but reached no desired effect. I checked my code many times and I don't really think that there some parameters block each other. Here how it looks on my side Here how I want it to look (Just without captions and navigation arrows) Here's my CSS code:
/* Flexible elements on the screen */ #navbarSupportedContent { display: flex; } /* Colors of navbar and text on it */ .nav-link { color: #000000; font-family: impact; font-size: 20px; text-shadow: -1px 0 #9f9f9f, 0 1px #9f9f9f, 1px 0 #9f9f9f, 0 -1px #9f9f9f; padding-top: 25px; } /* Center the login fields */ .loginfields { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100vh; } /* Removes scroll */ .login { overflow: hidden; } /* Change the stroke of the fields */ input[type="text"] { border: 2px solid grey; } input[type="password"] { border: 2px solid grey; } /* Change the color of the button */ .btn-primary { background-color: grey; } .btn-primary { border: 2px solid grey; } /* change the font of errors */ h1 { font-family: impact; font-size: 72px; } p1 { font-family: impact; font-size: 72px; } /* Fullscreen carousel images */ .carousel-item img { height: 100vh; width: 100vh; object-fit: cover; }
Here's my layout file:
CS50 Final Project: {% block title %}{% endblock %} For now keeping this line like this {% block main %}{% endblock %} can think about footer
Here's my main page code that displays carousel:
{% extends "layout.html" %} {% block title %}Main{% endblock %} {% block head %} {% endblock %} {% block main %}
2024.04.24 15:20 deadcoder0904Find Existing Startup Ideas making Millions $$$
Best way to succeed in startups is copying already successful startups. You don't need to be a genius to find an original idea. After all, everything is a remix. But where do you find these successful startups making millions? Well, its quite simple. 100s of Indiehackers have been tooting their own revenue on Twitter with the #buildinpublic hashtag. You can find them through it but its a tedious process. We can make it much simpler. Enter Acquire.com, previously known as MicroAcquire. Acquire is a marketplace for Startup Founders to sell their profit-generating Startups. These are usually small ones that are made by a team of 1-10 people. Since they are small, they are easy to copy. Acquire shows you everything from Revenue to Profit to Competitors to the Cost it takes to run. What they don't tell you is the exact startup domain. But if you are smart enough, you can find the exact domain through your OSINT and SOCMINT Skills. I'll include an example below. Just sign up at Acquire. Click on your Avatar on top right and click Explore Marketplace. You can find extremely good ideas on Acquire but I'll list a few that caught my eye:
1. Twitter outreach tool to find, reach and nurture prospects as well as grow your audience
Link: https://app.acquire.com/startup/zq3DbEFLHnZscyLRbTlxE1BosXv2/0wfJfThkimzDeVmJuieS?source=marketplace This product is a Cold DM tool that has $185 mrr. The total profit is $1k and the asking price is $30k. If you scroll down a bit, you'll find the founding date, the team size, the tech stack, the business model, the competitors, and the growth opportunities. The best part is when you scroll down a little further. You can find the exact Acquisition channels as it connects with Google Analytics. This is a good idea to build because let's be honest, every business needs leads. And what better way to get leads than to automate it with a Twitter outreach tool.
2. AI-Powered Roleplay Site running custom LLM model based off Meta's Llama
Link: https://app.acquire.com/startup/fMWCklAW4PPxiJ4xxpGKzu2Prct2/gvkmQYR8o3GFhG9pbYkS?source=marketplace Notice on the right there are 15 buyers interested. This shows demand. Investors are mostly interested in the fastest-growing startups. AI-Powered Roleplay is a huge market. We recently covered AI Girlfriends being a Billion Dollar Business and with the recent release of Llama 3, there will be more alternatives like this. This product is a 1-person product launched last year in June 2023. It has $5k in profit and $520 mrr but massive potential. If you scroll a bit, we get a Chartmogul graph of ARR, MRR, Customers, and Churn rate.
3. AI Photography Studio
Link: https://app.acquire.com/startup/daNCPe3tsEOyluwxQ5PybYIRVA53/KI3d9vSNWsE499iQjQqW?source=marketplace AI Photography Studios are all the rage launched during the 2nd wave (text-to-image) of AI. This one made $2.1m profit and $76k MRR. It had a TikTok go viral so you can assume they are acquiring customers to TikTok. Shouldn't be too hard to find, eh? They have said the competitors are Aragon and Headshot so you can cut those of your list now. There are only so many alternatives. You can nail this startup down even further. The metrics are 100,000+ customers. I'm sure they are boasting it on their landing pages. You can easily find this one.
4. A lead generation platform for businesses to generate and build email lists. 100% Organic Traffic.
Link: https://app.acquire.com/startup/nEOrnThIWNgtBK07TTdQ4Wbn3f73/eB78ZuQwKlVXFaszdnVJ?source=marketplace This one has 43 serious buyers. The description is extremely enticing. Hands-off and automated with traffic from Google? Of course, who doesn't like that. 4.7 rating on Trustpilot with 380 reviews!! And the competitor is Uplead. Metrics are incredible. ~$50k mrr ($578k / 12 months) with 100-1000 customers. The traffic is consistent. Try copying the description we found above and paste it into Google:
An all-in-one platform designed for businesses aiming to generate leads by extracting data from various social media channels and quickly building email lists, with an amazing Trustpilot rating of 4.7 based on over 380 reviews from satisfied customers.
And scroll down a bit to see Outscraper and LeadSwift recommended. Open them both up in the New Tab. Remember the listing had Tech Stack? Yep, we'll use that to nail it down further. Install Wappalyzer on your platform of choice. I use Chrome so I installed the Chrome Extension. Reload the websites (Outscraper and LeadSwift) so the extension loads. Now, you'll see only Outscraper is using WordPress and jQuery while LeadSwift only uses jQuery. But remember, they might be using React for their dashboard which you can only find after login. But I've found an important datapoint. Outscraper was founded earlier than 2022. You can check the Oldest Tab on their YouTube channel. Therefore, it might be Leadswift. A few tips:
Find their founding date and compare.
Find Trustpilot ratings and sort by reviews. Don't forget to search for "leads"
Stalk the founders on Linkedin to find their company starting date. You can also do that through YouTube Oldest Search.
Reverse-engineer their SEO strategy
Check their location on the website. The location in the listing is United States (Florida)
If you just want to build a startup in this niche, then the approximation is more than enough to get an idea of what to build. However, every listing gives enough info to find them. Some numbers might be misinterpreted to misdirect you. This is basically how you find successful startup ideas. Now you can build them and start marketing them. If you build it and nobody buys it, then you know your marketing sucks. Once you know that, you can improve your marketing skills by reverse-engineering your competitors. If you liked reading this, check out my post so you can see all this stuff with images. Don't forget to join the newsletter which contains daily tips on marketing/growth hacks to improve as a SaaS founder.
2024.04.18 14:39 tf1155Is SSR-mode fundamentally broken in VueJS?
There are many things that makes me think, that VueJS is broken fundamentally for SSR, when I stumble upon the famous error message "window is not defined". I think this makes only partially sense to take away the window object generally. For instance: In the router object, which should live only client-side, it is not possible to save the current mouse position because "window is not defined". How should one build a custom-scrollBehaviour-routine inside the Router-Object, to determine the current scroll position of the user? I'd like to save the current user position so that I can restore it when the user comes back. However, since my VueJS application uses SSR, I run frequently into the issue that the frontend part of my App is not able to reach the window object. Because of the SSR mode taking a global and essential tool away. The SSR part consumes only 5% of my Application but it causes the other 95% of the app not to work as expected. Taking away the window object globally in a Frontend Framework is like publishing jQuery without click-Event. The window-object is THE direct access to the user, to the frontend, to the browser. And VueJS is a frontend library, right? But not any more with SSR enabled. What do you guys think? What are your practices for dealing with a Frontend library without window-object? Especially in a case like mine where I want to customize the Routing-behaviour to restore the scroll-position upon navigating back and forth.
2024.04.10 14:19 artemis2110[AskJS] Debug and overwrite Js function
Hello, I'm making a Wordpress website using this theme: https://montagne.qodeinteractive.com/ If you click on the top right icon it will open a black drawer from the right, but if you scroll the page the drawer will close on its own. I'm trying to find and overwrite the function because I need it to stay open, but I can only find a jquery function with generic variable names. Can I get some help? Will delcare empty functions be enough to stop the behavior? Thanks
2024.04.06 21:27 Pretend-Sun16Help with creating a Paper Unrolling Effect
Hey everyone, I'm struggling to create a paper unrolling effect for a contact form. The idea is for the form to scroll up and unfurl like a piece of paper when the user hits submit. I saw something similar done here: Image Unroll Effects with Three.js Codrops (tympanus.net) using Three.js and shaders. https://reddit.com/link/1bxjwsc/video/jcner4peuwsc1/player I'd love to recreate this smooth scrolling and unrolling look for my form but I haven't been able to figure this out, or make that jquery threejs and shader code work within sveltekit. I'd be so grateful if anyone has experience with this type of UI element and could share some advice or point me to helpful resources. Even just a nudge in the right direction would be hugely appreciated. Let me know if you have any insights to offer! Thanks in advance.