Unfortunately I do not have an answer but I believe that I am running into the same issue.
Have you found a solution to this yet? If so, please post / share.
Thanks!
I'm facing the same issue. Were you able to solve it? If so, could you share the steps you took?
Hi i know its been a while but did you find a solution to this in the end? I'm facing a similar issue with iOS, Thank you
Are you found this solution? i have face this same problem?
You can find working example code and a live demo here: https://aibuildersguide.com/docs/gemini/gemini-search-grounding
I was able to make it work thanks to the advices of Lundin and JimmyB in the comments.
NOTE: This code works on my phisical Esp32(DEVKIT 1) since I got it. I have not tested it on the emulator.
What I was missing:
What I discovered:
I post here a working code in case someone gets stuck like me.
#include <stdio.h>
#include <unistd.h>
#include <inttypes.h>
#define GPIO_OUT_W1TS_REG (*(volatile uint32_t*)0x3FF44008)
#define GPIO_OUT_W1TC_REG (*(volatile uint32_t*)0x3FF4400C)
#define GPIO_ENABLE_W1TS_REG (*(volatile uint32_t*)0x3FF44024)
#define GPIO_ENABLE_W1TC_REG (*(volatile uint32_t*)0x3FF44028)
#define GPIO_FUNC0_OUT_SEL_CFG_REG 0x3FF44530
#define LEDC_CONF_REG (*(volatile uint32_t*)0x3FF59190)
#define LEDC_HSCH0_CONF0_REG (*(volatile uint32_t*)0x3FF59000)
#define LEDC_HSCH0_CONF1_REG (*(volatile uint32_t*)0x3FF5900C)
#define LEDC_HSCH0_DUTY_REG (*(volatile uint32_t*)0x3FF59008)
#define LEDC_HSCH0_DUTY_R_REG (*(volatile uint32_t*)0x3FF59010)
#define LEDC_HSCH0_HPOINT_REG (*(volatile uint32_t*)0x3FF59004)
#define LEDC_HSTIMER0_CONF_REG (*(volatile uint32_t*)0x3FF59140)
#define IO_MUX_GPIO26_REG (*(volatile uint32_t*)0x3FF49028)
#define DPORT_PERIP_CLK_EN_REG (*(volatile uint32_t*)0x3FF000C0)
#define DPORT_PERIP_RST_EN_REG (*(volatile uint32_t*)0x3FF000C4)
#define LEDC_HSTIMER0_VALUE_REG (*(volatile uint32_t*)0x3FF59144)
#define resolution (uint)8
void app_main(void)
{
printf("test\n");
DPORT_PERIP_CLK_EN_REG |= (1<<11);// enable clock for ledc
LEDC_HSTIMER0_CONF_REG &= ~(0xf);
LEDC_HSTIMER0_CONF_REG |= resolution; //resolution = 8 bit
uint divider = 80000000 / (5000 * 256);
LEDC_HSTIMER0_CONF_REG |= (divider<<13);
LEDC_HSCH0_CONF0_REG &= ~(0b00); //timer 0
LEDC_HSCH0_CONF0_REG |= (1<<2); //enale output channel
LEDC_HSCH0_HPOINT_REG = 1; // value to set high
LEDC_HSCH0_DUTY_REG &= ~(0xffffff);
LEDC_HSCH0_DUTY_REG |= (20<<4); // low duty cycle
uint low = 1; // flag to control next duty value
// gpio setting
volatile uint32_t* gpio26_cfg = (volatile uint32_t*)GPIO_FUNC0_OUT_SEL_CFG_REG + 26;
// peripheral 71 -> hschan0
*gpio26_cfg = 71;
GPIO_ENABLE_W1TS_REG |= (1<<26);
// function 2
IO_MUX_GPIO26_REG &= ~(0b111 << 12);
IO_MUX_GPIO26_REG |= (2<<12);
LEDC_HSCH0_CONF1_REG |= (1<<31); // start channel duty cycle
LEDC_HSTIMER0_CONF_REG &= ~(1<<24); //reset timer
uint counter = 0;
while (1) {
if (counter == 2){
if (low == 0) {
LEDC_HSCH0_DUTY_REG &= ~(0xffffff);
LEDC_HSCH0_DUTY_REG |= (30<<4);
low = 1;
LEDC_HSCH0_CONF1_REG |= (1<<31); // start channel duty cycle
} else {
LEDC_HSCH0_DUTY_REG &= ~(0xffffff);
LEDC_HSCH0_DUTY_REG |= (128<<4);
low = 0;
LEDC_HSCH0_CONF1_REG |= (1<<31); // start channel duty cycle
}
counter = 0;
}
printf("timer value: %" PRIu32 "\n", LEDC_HSTIMER0_VALUE_REG);
printf("duty value: %" PRIu32 "\n", LEDC_HSCH0_DUTY_R_REG);
printf("counter: %d\n", counter);
sleep(1);
counter++;
}
}
Since I am a newbie in C please feel free to correct me as Lundin did, I will appreciate it.
I’ve also been trying to fetch Google reviews using the new Places API with an unrestricted API key and a properly set billing account, but I’m still getting REQUEST_DENIED
. I’ve confirmed that my API key works for other requests (like address components) but fails for reviews. It seems like accessing reviews might require the Enterprise SKU, but I haven’t found a way to enable it. Has anyone managed to solve this?
i have been coding by myself for a year and i wanted to make a similar game but it doesn't work with me either. My code is close to identical to yours,
import turtle
# create Screen
wn = turtle.Screen()
wn.bgcolor("light green")
# Create player
player = turtle.Turtle()
player.color("blue")
player.shape("triangle")
player.penup()
speed = 1
#create the inputs
def left():
player.left(30)
def right():
player.right(30)
#Key input actions
turtle.listen()
turtle.onkeypress(left, "Right")
turtle.onkeypress(right, "Left")
while True:
player.forward(speed)
i've tried everything and it just doesn't work. I think that it does not work because the program is not listening (although i fired the function listen()) because i have put this line in my program:
def print_test():
print("works")
with this in the keyinputactions
turtle.onkeypress(print_test, "Space")
and it gave me nothing as an output. I think you might have the same problem. I however do not know how to fix this because of my lack in expertise.
I hope this helped, although i do not think that you are still working on this problem after 2 years.
do you consider using shader graph?
How about using requirements.txt
?
requirements.txt
djlint==1.36.4
Then run
$ pip install -r requirements.txt
Thank You for this answer @Bowman Zhu . This was pretty simple but saved me :)
I am also experiencing similar thing. All the hs-consumer-api endpoints are returning 403 status. I guess now the endpoints need hmac authentication.
@Neel, were you able to find a solution for this?
Muito obrigado, salvou meu laboratório!!!
Thanks Cyril Gandon <3 for providing the perfect answer to it.
I changed @workingdogsupportUkraine code. The only thing is that it is not showing keyboard just by tapping on the search button. It is showing cancel button after I changed the code.
struct SearchbarView: View {
@Binding var text: String
@State private var showSearch: Bool = false
var onSubmit: () -> Void
var body: some View {
VStack {
HStack {
Spacer()
if showSearch {
SearchBar(text: $text, showSearch: $showSearch, onSubmit: onSubmit)
.frame(width: 350, height: 40)
} else {
Image(systemName: "magnifyingglass")
.onTapGesture {
showSearch = true
}
}
}
}
}
}
struct SearchBar: UIViewRepresentable {
@Binding var text: String
@Binding var showSearch: Bool
var onSubmit: (() -> Void)
func makeUIView(context: Context) -> UISearchBar {
let searchBar = UISearchBar()
searchBar.isEnabled = true
searchBar.searchBarStyle = .minimal
searchBar.autocapitalizationType = .none
searchBar.placeholder = "Search"
searchBar.delegate = context.coordinator
searchBar.setShowsCancelButton(true, animated: true)
return searchBar
}
func updateUIView(_ uiView: UISearchBar, context: Context) {
uiView.text = text
}
func makeCoordinator() -> Coordinator {
Coordinator(self)
}
class Coordinator: NSObject, UISearchBarDelegate {
let parent: SearchBar
init(_ parent: SearchBar) {
self.parent = parent
}
func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
searchBar.showsCancelButton = true
parent.text = searchText
}
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
searchBar.resignFirstResponder()
searchBar.showsCancelButton = true
searchBar.endEditing(true)
parent.onSubmit()
}
func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
parent.text = ""
searchBar.resignFirstResponder()
searchBar.showsCancelButton = false
searchBar.endEditing(true)
parent.showSearch = false
}
func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool {
searchBar.showsCancelButton = true
return true
}
}
}
Please help me with keyboard focus and cancel should be highlighted after I tapped the search button. Now by tapping on cancel it also dismisses the search.
I have encountered similar situations and tried to explain the solution here.
https://mcuslu.medium.com/aws-dynamodb-json-data-import-some-tips-and-tricks-fb00d9f5b735
Same here, accesing ESIOS
curl works, but for some reason requests 2.32.3 fails with 403 code.
Any workaround?
Thanks a lot. Yes, using the .
solved the problem. Many thanks again for taking the time.
I manage to fix this problem. The the new problem what i have its, this extension cannot update the quantity from stock. How to fix this?
can btcrecover help in recovery passphrase of pi wallet
if so, please help with directive
note> I have the wallet receive addresss and the passphrase with two or three word spells wrongly.
Here is a new one in a development.
Hey I need a permit to create Microsoft computer training program at by using the signature of the company I'll give my details yeah this is my name is valla Venkat Sai Rahul you please give the next this name on this can you please send certification
did you create a project because of the
Thank you for answering your question. I was losing my mind. Trying to figure out why my config wasn't pulling all the data I needed
Do you want time like this website
http://freecine.store/
I used timer of 5 seconds so i can help you to apply same strategy. But my website is in wordpress CMS can you tell me your built in technology.
Fitsumking7 strong textttyyhhhjjhhhhghbhhjjjjjjjjiiiiiiiiiiiijjjj
Blockquote
Ask ChatGPT, this is a simple answer.
Definitely check this article -> https://blog.nashtechglobal.com/how-to-deploy-express-js-to-vercel/
This documentation maybe will help a bit: https://docs.unity3d.com/6000.0/Documentation/ScriptReference/Light-colorTemperature.html
What is the current directory? Very likely the path in which the executable resides.
Any answer? I have the same issue.
BR
Paco
I am not strong in Excel. I have never used script or record. I have a site map with typed numbers in the cells but I want them to have colons because they are MAC address's. I have tried alot of these ideas but it cuts out numbers/letters. If i make a whole copy of just one large set I have got it to work ish. I copy it and erase my old cell info to paste in the new stuff but both disappear when I do it? Any ideas for a learner of this?
Raka Putra how did you fix the error
I'm not giving an answer, but rather trying to get this to work for me. I put in the Service, Cluster, and DesiredCount, but nothing happens that I can see. I don't know where to go to see any kind of log to tell me whether or not it ran and/or what the error might be.
Any help would be appreciated.
Thanks.
Anyone found a workaround in this except using list for recursive property?
https://www.checkout-ds24.com/redir/599344/Cashif0123/
kindly convert it into iframe
whtsapp +923350217783
олоecwwecwecwecwewec weccewcwecwecwecwec
in python 3.9.2 same error, why?
Me pasaba lo mismo y probe todo. Al final lo conseguí dandole una patada a la cpu y desactivando el plugin de wordpress gosmtp y go smtp pro en ese orden y volviendo a activarlos en igual orden. luego he dejado clickado las dos opciones de force from email y force from name y ya todo ok. gracias a todos.
What is the integral of the function f(x) = sin 2x?
Checkout this repository which is a port of the famous Microsoft eshopOnContainers project. https://github.com/harshaghanta/springboot-eshopOnContainers
And I need it to be next to each other and not below each other
This project builds a macOS app for Meld
https://formulae.brew.sh/cask/dehesselle-meld#default
Works great
Have you found a way to solve this problem? I know for sure that it can be done, but I can't find a solution yet
I hope ok for everything. It's been a while but I wanted to ask. I'm having the same problem. I want to show the version of the app in the bottom right corner before the screenshot is taken and include it in the screenshot but I haven't found a solution yet.
I get versiyon number with package_info_plus package and this ok. and i using screenshot_callback package. This one is not work before screenshot.
Do you have any solution for this issue?
Thanks for everything!
I recommend looking over this VS2017+ extension:
https://marketplace.visualstudio.com/items?itemName=darkdaskin.tabpath
More information can be found in the original post: https://stackoverflow.com/a/79511184/2109230
Rollback to 17.12.4 solves the problem.
I have the same issue, to solve it just change jakarta to javax in all files
import jakarta.inject.Inject
to
import javax.inject.Inject
I found a solution! It is from this thread: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360010648239-CLion-stopped-recognising-project-as-a-CMake-project. All I had to do was close the project, delete the entire .idea folder and open it again.
I have a similar problem. I use internal CSS in my project. I load the HTML files from the asset/html directory in my project. The HTML files are loaded without problems but the internal CSS in these files does not work. Does the package webview_flutter: ^4.10.0 not support internal CSS but only external CSS?
Thanks in advance
Best regarts
Petra
Did you find a Solution? Having the same issue.
Well-written and insightful. Keep up the good work!iimskills medical coading cources in delhi
@PBulls thank you for your reply. I changed the ggemmeans code as you suggested. However, the outcome is still not linear. The Y-scale shows percentages, not log odds. Any idea how I can solve this?
ggemmeans(LMM_acc, terms = c("time_position.c", "response_side"), back.transform = FALSE) %>%
plot() +
geom_line(size = 2) +
aes(linetype = group_col) +
theme(legend.title = element_text(size = 30),
legend.position = 'top',
legend.key.size = unit('1.5', 'cm'),
axis.title.y = element_text(size = rel(2), angle = 90),
axis.title.x = element_text(size = rel(2)),
axis.text.x = element_text(size = 20),
axis.text.y = element_text(size = 20)) +
scale_colour_manual("response_side", values = c("purple","orangered")) +
scale_fill_manual("response_side", values = c("purple","orangered"),
guide = "legend") +
scale_linetype_manual("response_side", values = c(2,1)) +
guides(fill = guide_legend(override.aes =
list(fill = c("purple","orangered"))))
i thinks vs code error please refresh pc and try again then after its work properly .
Para resolver este inconveniente, puede intentar las siguientes soluciones:
Actualizar CocoaPods: Asegúrese de que CocoaPods esté actualizado a la última versión, ya que las versiones más recientes pueden contener correcciones para este tipo de errores.
bash
Copiar código
$gem install cocoapods
Actualizar la gema activesupport: Es posible que la versión actual de activesupport tenga conflictos. Intente actualizarla a una versión más reciente.
bash
Copiar código
$gem update activesupport
Verificar la versión de Ruby: Algunos usuarios han informado que ciertas versiones de Ruby pueden causar conflictos con las gemas. Considere actualizar Ruby a una versión compatible y estable.
Limpiar el caché de CocoaPods: A veces, los archivos en caché pueden causar problemas. Limpie el caché y vuelva a instalar los pods.
bash
Copiar código
$pod cache clean --all
$pod install
Ejecutar pod install con Bundler: Si está utilizando Bundle para gestionar las dependencias de Ruby, asegúrese de ejecutar pod install a través de Bundle para garantizar que se utilicen las versiones correctas de las gemas.
bash
Copiar código
$bundle exec pod install
i have the same problem and solved it by removing the node_module folder and pakage-lock.json file
Remove-Item -Recurse -Force node_modules to remove node_module folder
Remove-Item -Recurse -Force package-lock.json to remove package-lock.json file
then install them again by npm install
I am currently integrating IAP in my app ,
I created a consumable in IAP in appstoreconnect , then a storeKitConfiguration file in app and synced it , it synced correctly and I am able to do purchase in simulator.
But when I upload the app on TestFlight , I am not able to see any consumable in testing device . I sent it for review and it got rejected for the same reason that they don't see any consumable in their device.
Can you please help me !!
Yes, in central Asia there are first name, Surname and Tribe name. There are many places to see in Mongolia.
header 1 | header 2 |
---|---|
cell 1 | cell 2 |
Good morning
You mentioned “when compiling not for Windows” but from the screenshot it looks like you are compiling from windows. If that is the case Intellisense will detect the system (i.e windows) will show information accordingly. Can you give more information on other system and how are doing the compilation for that?
Check out this article for deploying React website on GitHub pages: Host react website on Github pages
Any fix for this? i need to have the list initialized by default
Can I use this function for any number of bytes say 9 ??
How to implement this function if my data is transmitted in a loop ?
Cannot Resolve symbol R ??
I also have the same issue I try many things to solve the problemlike invalidate caches etc many times but failed I find it on Google but not find the answer then i suddenly or intentionally check out my imports I look like import android.annotation.SuppressLint.R then i just remove the R and the error is solved
import android.annotation.SuppressLint and the error is solved
so I find this solution to the given problem.
I made this literally just a few days ago and just saw this! link: https://nellowtcs.github.io/HTMLNodeMapper GitHub: https://github.com/NellowTCS/HTMLNodeMapper
did you ever found a solution?
May i ask if you have lot of categories and inside that categories you include images and containers for titles and etc. which is performing faster? tab or accordion? Is both loading all the content or just the first tab/accordion? I already face a problem...i try to create my page by adding tabs...but unfortunately it slows down elementor....so i would like to know if is better to try with accordions...if that widget is lighter... there is and a third option to create the menu with buttons...but is not so friendly users solution...so please if somebody can help i will appreciate it a lot!!! thanks in adnance!!!
The given link https://install.pytorch.site/?device=CUDA+10.0 - is broken and not working
Did you ever figure out the solution?
Not an answer but Here's the the info I've found about:
https://developer.apple.com/forums/thread/763311
https://developer.apple.com/forums/thread/659621
Have you looked at Spark tuning?
I have a question if I have two users one user will login but second user will not access the first user data without their authentication and if they will login the admin the admin page redirect to home please give me a solution for this i have two users for authentication?
For newer systems, Ubuntu 24+
Follow the steps given here - https://docs.docker.com/engine/security/rootless/
what config eventually worked?
Get it off me! This thing is terrible - make it go away.
OR does anyone now another Editor with easy ftp integration ?
Thank you very much for sharing your problem. It was the same as mine, it saved me here. Thanks, my friend.
Tenia el mismo problema y me di cuenta qué el ícono de 1024 * 1024 no debe tener bordes redondeados.
Puedes probar eso!
may be you need docker? ew, maybe. i just cant exactly know what is S3 bucket
I'm trying to use the Secure PDF plugin in Moodle 4.5 on a local Apache server. I've made all the changes mentioned for the ImageMagick theme, but it still doesn't work. Any suggestions?
Change policy.xml as follows:
<policymap>
<policy domain="delegate" rights="read|write" pattern="gs" />
<policy domain="coder" rights="read|write" pattern="PDF" />
<policy domain="delegate" rights="read|write" pattern="gswin64c" />
</policymap>
But when I upload a document to Moodle, it throws the following error:
ImagickException: FailedToExecuteCommand "gs" -sstdout=%stderr-dQUIET-DSAFER-DBATCH-DNOPAUSE-DNOPROMPT-dMaxBitmap=500000000-dAlign ToPixels=0-dGridFitTT=2"-SDEVICE=pngalpha" -dTextAlphaBits=4-dGraphicsAlphaBits=4 "-r150x150"-dPrinted=false*-sOutputFile=C:/Users/INNOVA~1/AppData/Local/Temp/magick-6Mjg7ywlThqzo3HGDLdGq0_2TmNV8ERx%d" "-fC:/Users/...AppData/Local/Temp/magick-K-JKeJ5TTiNf90cEz5-Kq0SwYdHxKxXx" "-fC:/Users/.../AppData/Local/Temp/magick-gyUWDIH8th4X3P540qJayx5JgNDVKrS-" (El sistema no puede encontrar el archivo especificado.)
@error/delegate.c/ExternalDelegateCommand/516 in
C:\Users\...\server\moodle\mod\securepdf\view.php:98 Stack trace: #0
C:\Users\...\server\moodle\mod\securepdf\view.php(98): Imagick->readImageBlob('%PDF-1.7\r\n%\x35\x35\x35\xB5...) #1 (main)
I appreciate any help you can give me.
After go to PSS the behavior (performance) is similar to 4.X?
b15 Did you find a solution to this. I am facing exactly the same issue while running a spark job in GCP dataproc.
I’m facing the exact same issue as you. Did you manage to find a fix or a workaround? Any help would be appreciated!
broooo como lo solucionaste? es muy confuso para mi
check if you have duplicate id's (id="review" on more than one of your elements)
Did anyone try using singleton class as global variables in a Flink app ? Accessing the singleton class in all streams and aggregate windows ?
Maybe, this explanation can help you.
Bro facing same issue
please tell if you find solution
Have you checked that all the packages (in pubspec.yaml) you are using are compatible with Android and iOS?
Such a simple fix! Scratching my head... why does the prefilled disappear?
Thanks!!
upvote is not working... for me
it's possible to have only the price, not the name product
thanks
we're seeing this but for user_pseudo_id (i.e. multiple traffic_source.source and traffic_source.medium where this should only reflect the initial traffic orogins for that particalar user_pseudo_id. anyone else getting this issue in BigQuery?
Thanks. I'm having the same problem and this post was helpful. But, I have an additional issue. When I try to install Snowsql, both the cmd prompt and terminal stop accepting input at the password prompt. I type, but nothing happens. Any ideas on address that? Thanks!
apache commons...
StringUtils.substringBeforeLast(principalName, "@")
I am facing the same issue , but less secure apps is deprecated so what do I use??
just got the same issue. Thanks for the post.
Do you have any simpler alternatives that dont require setting up a lambda?
Skip to main content
Stack Overflow
Products
OverflowAI
Search…
Umer Masood's user avatar
Umer Masood
1, 1 reputation
●22 bronze badges
Home
New
Questions
Tags
Saves
Users
Companies
Labs
Discussions
Collectives
Communities for your favorite technologies. Explore all Collectives
Teams
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Looking for your Teams?
carousel using jQuery
Asked 11 years ago
Modified 11 years ago
Viewed 18k times
Report this ad
4
I know there are plugins available out there, but I'm trying to make one of myself but before that I'm trying to understand the concept of making it as an infinite/circular carousel. Here is my jsfiddle so far.. http://jsfiddle.net/hbk35/KPKyz/3/
HTML:
<div id="carousel_wrapper">
<ul>
<li>
<div>0</div>
</li>
<li>
<div>1</div>
</li>
<li>
<div>2</div>
</li>
<li>
<div>3</div>
</li>
<li>
<div>4</div>
</li>
<li>
<div>5</div>
</li>
<li>
<div>6</div>
</li>
<li>
<div>7</div>
</li>
</ul>
</div>
<br>
<div id="buttons">
<button id="left">left</button>
<button id="right">right</button>
</div>
JS:
var container = $("#carousel_wrapper");
var runner = container.find('ul');
var liWidth = runner.find('li:first').outerWidth();
var itemsPerPage = 3;
var noofitems = runner.find('li').length;
runner.width(noofitems * liWidth);
container.width(itemsPerPage*liWidth);
$('#right').on('click',function(){
runner.animate({scrollLeft: -liWidth},1000);
});
$('#left').on('click',function(){
runner.animate({scrollLeft: liWidth},1000);
});
CSS:
div#carousel_wrapper{
overflow:hidden;
position:relative;
}
ul {
padding:0px;
margin:0px;
}
ul li {
list-style:none;
float:left;
}
ul li div {
border:1px solid white;
width:50px;
height:50px;
background-color:gray;
}
I do not want to use clone and detach method. Is there any other way to do that? Please anyone would like to guide me where I'm making mistake. I'm newbie to stack overflow and javascript/jquery also..trying to learn on my own. Forgive me I'm trying since to put my code onto the question, couldn't get neat and separate like others.
Thanks!!
javascriptjquerycsscarousel
Share
Edit
Follow
edited Feb 27, 2014 at 19:31
asked Feb 27, 2014 at 19:22
harshes53's user avatar
harshes53
42911 gold badge77 silver badges1717 bronze badges
2
We need a reinventing-the-wheel tag on SO –
Dryden Long
CommentedFeb 27, 2014 at 19:24
The code in the fiddle doesn't match the code in your question. –
j08691
CommentedFeb 27, 2014 at 19:27
@j08691 my apologies. the fiddle is updated. thanks. –
harshes53
CommentedFeb 27, 2014 at 19:32
Are you looking to implement the carousel from jquery framework or any other framework –
Someone
CommentedFeb 27, 2014 at 19:50
@Someone using jQuery framework. actually I'm trying to make plugin of it. and to make it circular/infinite. –
harshes53
CommentedFeb 27, 2014 at 19:58
Show 2 more comments
2 Answers
Sorted by:
Highest score (default)
3
Here you go an infinite. Could be done with less code for sure. http://jsfiddle.net/artuc/rGLsG/3/
HTML:
<a href="javascript:void(0);" class="btnPrevious">Previous</a>
<a href="javascript:void(0);" class="btnNext">Next</a>
<div class="carousel">
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li>10</li>
<li>11</li>
<li>12</li>
<li>13</li>
<li>14</li>
</ul>
</div>
CSS:
.carousel{
padding-top: 20px;
width: 357px;
overflow: hidden;
height: 50px;
position: relative;
}.carousel ul{
position: relative;
list-style: none;
list-style-type: none;
margin: 0;
height: 50px;
padding: 0;
}.carousel ul li{
position: absolute;
height: 25px;
width: 50px;
float: left;
margin-right: 1px;
background: #f2f2f2;
text-align: center;
padding-top: 25px;
}
JS:
$(function(){
var carousel = $('.carousel ul');
var carouselChild = carousel.find('li');
var clickCount = 0;
var canClick = true;
itemWidth = carousel.find('li:first').width()+1; //Including margin
//Set Carousel width so it won't wrap
carousel.width(itemWidth*carouselChild.length);
//Place the child elements to their original locations.
refreshChildPosition();
//Set the event handlers for buttons.
$('.btnNext').click(function(){
if(canClick){
canClick = false;
clickCount++;
//Animate the slider to left as item width
carousel.stop(false, true).animate({
left : '-='+itemWidth
},300, function(){
//Find the first item and append it as the last item.
lastItem = carousel.find('li:first');
lastItem.remove().appendTo(carousel);
lastItem.css('left', ((carouselChild.length-1)*(itemWidth))+(clickCount*itemWidth));
canClick = true;
});
}
});
$('.btnPrevious').click(function(){
if(canClick){
canClick = false;
clickCount--;
//Find the first item and append it as the last item.
lastItem = carousel.find('li:last');
lastItem.remove().prependTo(carousel);
lastItem.css('left', itemWidth*clickCount);
//Animate the slider to right as item width
carousel.finish(true).animate({
left: '+='+itemWidth
},300, function(){
canClick = true;
});
}
});
function refreshChildPosition(){
carouselChild.each(function(){
$(this).css('left', itemWidth*carouselChild.index($(this)));
});
}
});
Share
Edit
Follow
edited Feb 27, 2014 at 21:09
answered Feb 27, 2014 at 20:30
artuc's user avatar
artuc
9131111 silver badges2020 bronze badges
There was a bug when you fast click. Added finish() method to JS fiddle: jsfiddle.net/artuc/rGLsG/2 –
artuc
CommentedFeb 27, 2014 at 20:38
works like a charm! awesome this is what i was looking for... thanks!! but theres a small issue with it.. if you keep pressing next button, you will find an space between 1&2 li elements. –
harshes53
CommentedFeb 27, 2014 at 20:55
1
Yep, neither animate nor finish seems to work if you click really fast. I implemented a dirty solution to it. Please see the updated fiddle: jsfiddle.net/artuc/rGLsG/3 also removed one useless function. –
artuc
CommentedFeb 27, 2014 at 21:07
yeah i see the problem with your updated fiddle. if u click left continuously and fast, u will see the first element not there + some random space in between. else previous button works awesome!! thanks though! –
harshes53
CommentedFeb 27, 2014 at 21:52
i think if we can fix the random space issue! –
harshes53
CommentedFeb 27, 2014 at 21:56
Show 1 more comment
Report this ad
3
Here you go: http://jsfiddle.net/KPKyz/5/
JS
var container = $("#carousel_wrapper");
var runner = container.find('ul');
var liWidth = runner.find('li:first').outerWidth();
var itemsPerPage = 3;
var noofitems = runner.find('li').length;
runner.width(noofitems * liWidth);
container.width(itemsPerPage*liWidth);
$('#right').click(function() {
$( runner ).animate({ "left": "-=51px" }, "slow" );
});
$('#left').click(function() {
$( runner ).animate({ "left": "+=51px" }, "slow" );
});
CSS
div#carousel_wrapper{
overflow:hidden;
position:relative;
width:500px;
height: 100px;
}
ul {
padding:0px;
margin:0px;
position: absolute;
top:50px;
left: 0px;
width:300px;
height: 50px;
overflow: hidden;
}
ul li {
list-style:none;
float:left;
}
ul li div {
border:1px solid white;
width:50px;
height:50px;
background-color:gray;
}
Share
Edit
Follow
answered Feb 27, 2014 at 19:53
Ani's user avatar
Ani
4,52344 gold badges2828 silver badges3232 bronze badges
Thanks, was looking for something like that without additinoal plugins –
user133408
CommentedFeb 27, 2014 at 19:58
1
Oh..I thought you were OP :P ...My bad –
Ani
CommentedFeb 27, 2014 at 19:59
@Ani thats awesome. two more question. why i cannot use liWidth if I'm not aware of the width? how can i make it circular/infinite?? appreciate it. –
harshes53
CommentedFeb 27, 2014 at 20:02
1
Oh...I didn't knew you want circular...hold on –
Ani
CommentedFeb 27, 2014 at 20:04
Add a comment
Your Answer
Reminder: Answers generated by AI tools are not allowed due to Stack Overflow's artificial intelligence policy
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
Please be sure to answer the question. Provide details and share your research!
But avoid …
Asking for help, clarification, or responding to other answers.
Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
javascriptjquerycsscarousel
See similar questions with these tags.
The Overflow Blog
Can climate tech startups address the current crisis?
What we learned at TDX 2025
Featured on Meta
Community Asks Sprint Announcement - March 2025
Meta Stack Exchange site maintenance scheduled starting Monday, March 17,...
Policy: Generative AI (e.g., ChatGPT) is banned
Stacks Editor development and testing
Is it better to redirect users who attempt to perform actions they can't yet...
Hot Meta Posts
14
What is the role of this new bottom notice on questions, below the answer box?
Report this ad
Report this ad
Linked
0
Scrolling/carousel with interval
-1
jQuery carousel - disable next/previous link when last item on the list is reached
Related
0
jQuery carousel
0
Circular Carousel (jQuery)
0
Make a carousel with divs
0
Carousel Jquery/Javascript
4
Trying to create a carousel effect with jQuery
0
how to make a jquery carousel
3
Make a carousel using JavaScript
0
Please help me with this carousel
0
Using JQuery to carousel through divs
0
How can i make this carousel working with JS and CSS?
Hot Network Questions
Has the Trump administration explained how they're going to get people to the Moon/Mars if they're reducing the size of NASA?
Building an 8080 based computer
PTIJ: Why did Mordechai insist on Esther ploughing (החרש תחרישי) at such a crucial moment?
Does this average exist?
Is the US debt "crisis" fake?
Is Oz a real place?
With what to replace uBlock Origin now after Google Chrome nerfed it?
What arguments can a developer make to management that he could be Product Owner for his Scrum team?
Is crypto sniping illegal?
Did Trump campaign against gay people?
Do any Tribes actively involve kinfolk in the fight for Gaia?
Why are the download sizes so much bigger than they actually are?
How can visa officials know I ‘visa shopped’
Converting EU motors 230V 30A for U.S. use
How do I start a tie from a grace note to another note in Lilypond?
Am I better off concocting my own chain wax?
How to Reorder Piecewise Function Compositions
What is the swap.img in Disk Analyzer
Did Asimov ever comment on whether the name of this Foundation character was a deliberate clue?
How would a society with no wood reliably heat itself?
"Naïve category theory", or, pedagogy and how to Introduce natural transformations?
Why Do We Take the Derivative of the Basis Vector When Calcuating the Acceleration in Polar Coordinates?
The arrows are not aligning
How to mount a headboard intended for bed to a wall instead?
Question feed
Stack Overflow
Questions
Help
Chat
Products
Teams
Advertising
Talent
Company
About
Press
Work Here
Legal
Privacy Policy
Terms of Service
Contact Us
Cookie Settings
Cookie Policy
Stack Exchange Network
Technology
Culture & recreation
Life & arts
Science
Professional
Business
API
Data
Blog
Facebook
Twitter
LinkedIn
Instagram
Site design / logo © 2025 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2025.3.14.23870
i have the same issue, someone managed to fix it?