Create jQuery Slider Range With One Handle Not Using Min/Max - jquery-ui

Is there any possible way to create a slider that will create a range similar to what is done with one handle using min/max, only instead of min/max, starting the range from say 50 (on a scale from 1-100)? I realize this will most likely require modification of the slider or creating a plugin, just wondering if anyone has done this already or knows how to go about it.
I.e. something like this: http://jqueryui.com/demos/slider/rangemin.html
Only, instead of the range going from the min, going off of where the handle is, and allowing the user to slide either left or right of that fixed starting point to create the range. Any help is appreciated, and I'd be glad to clarify what I need if that doesn't make sense! :)

I'm not sure I understand the question. You want something (what?) to be based on the initial position of the slider "thumb"???

Related

using excel to show Increase, Decrease and no change in Multiple colours

Looking for some help or to be pointed in the right direction. Been stuck on this for a while and the main issue is I don't even know where to start. I am sure there is a solution but my brain will not see it.
To use as an example I have a table that shows monthly results for multiple different areas:
What I want to do is in the gap along side each number is show an increase, decrease or no change, using up arrow down arrow and square. That I can do using conditional formatting my issue comes with the fact that I also want it to be multiple Colours. So it will take into account increase and decrease and whether they are in target.See below:
Atm I am copying and pasting each month. But having it automated would be amazing. The outcome would hopefully look like this:
I am hoping there is a way that I can do two things compare to the previous month and then check it against my table to see where it sits then display the appropriate symbol.
Thank you in advance for any help or a place to start.
So extremely easy to figure out once I looked at it in a simplistic way.
Firstly, I used: =IF(-SIGN(E26-G26)= 0, "n", IF(-SIGN(E26-G26)=1, "é", IF(-SIGN(E26-G26)=-1, "ê","")))
To compare the current number to the previous number and get a 1, 0 or -1 depending on if it had gone up down or stayed the same, using this it either displays é, n or ê. I then set the font on these cells to Wingdings. so they become up arrow, down arrow and a square.
Then I use conditional formatting to colour it based on the adjacent cells value.
No need for a long, complex formula
=IF(A2>A1,"t",IF(A2<A1,"u","v")) - set the font to Marlett

Corona SDK dynamic width objects

I'm trying to implement a game mechanics of "Hooking" objects... Here's picture of what i'm talking about:
But I have a problem with the chain/string of the hook.
I've tried create it step by step when the hook is on the fly, using timer and enterFrame events, but they both generate huge gaps between chain segments.
I've tried creating big image of whole chain and changing width dynamicly, but it only stretches and looking funny :D
Maybe anyone faced the same problem?
I would suggest you to try following.
Create whole chain
place it inside container (display.newContainer)
change width of container.
Container automatically generates masks so instead of stretching you will have just part of your chain hidden under mask.
here is link to container docs http://docs.coronalabs.com/daily/guide/graphics/container.html
This is not a complete answer - I have given you a bit of a broad answer to a broad question but I hope it can help you in creating what you need.
I created a very similar mechanic recently -
I used enterFrame to call a function, lets call it BuildHook, this would check the position of the hook and the position of the starting point and then calculate how many pieces of images would be needed to fill out the space. The graphic I had as my "hook" was partially larger then the chain pieces allowing for it to overlap and only put a new image once enough space between the last piece and hook was created.
This ment that it was the hook moving forward and backwards and then having a static "chain" between it and the starting point. Either consuming "links" as would move backwards ontop of them or created "links" as it moved away from them.
Keep in mind this is pseudo code but should give you an idea how to make it.
local arrayOfPieces = {}
local function BuildHook()
-- Bunch of variables you need to get
startX,startY,
hookX,hookY,
lastPieceX,lastPieceY,
singlePieceWidth
-- The hook pseudo code
if(hookX - lastPieceX >= singlePieceWidth) then
local newPiece = display.newImage('singlePiece.png');
newPiece.x = lastPieceX + singlePieceWidth/2
newPiece.y = lastPieceY
table.insert(arrayOfPieces,newPiece)
end
if(hookX < lastPieceX) then
lastPieceArrayPos = table.getn(arrayOfPieces)
table.remove(arrayOfPieces,lastPieceArrayPos)
lastPiece = arrayOfPieces[lastPieceArrayPos - 1]
end
end

How do I make my highstock's graph y axis is just absolute value?

Hello I'm original using highcharts
because my clients has need to see different view based on time,
like 1day,2day,3day,7day,1month, so I figure out highstock is more resemble
to this, but using highstock is missing some feature.
while I successfully figure out how to add legend(legend), change point display
(tooltip:formatter), change xaxis display and navigator display(dateTimeLabelFormats),
I see the display of line just like stock, which means:
it doesn't consider the absolute value of which too much, like I have connected terminals varying from 8-10, registered terminals varying from 2-3, unfornately it will draw registered terminals above connected terminals, which doesn't quite make sense, (besides the yAxis display is not correct, when it draw 5, the point above which actually says 4..), I also tried
plotOptions: {series: {compare: 'percent'}},
and
plotOptions: {series: {compare: 'percent'}},
but doesn't work, the y Axis is still quite confusing,
does anybody has a good solution? Thanks.
Had the same issue recently. It basically come from leaving useless parts of the example code in :D
Taking out the
plotOptions: {series: {compare: 'percent'}},
part should make it use the absolute values.
I assume taking out the compare parameter alone should be enough as well but since its the only thing you set from the plotOptions there is no need to keep the rest.

Shifting elements in match3 kind of game

I am a beginner at ActionScript3, and for my learning purpose, I am trying to build a match3 kind of game. I am making is a clone of bejeweled kind of game. but instead of swapping, I have to delete those elements and shift the upper elements down and add new elements above those shifted elements.
I am able to delete matched elements and after matching I'm removing those elements but I am stuck with the shifting code. I am not able to shift those elements down.
I believe that you should take a look at Richard Lord's Tetris source code as your game may be somehow similar in mechanics to Tetris. Tetris shifts down rows when you get lucky.
Richard Lord is one of the Flash Gurus and his way of doing things may seem pretty advanced for a starter like you. Take a look over the source code and see if it fits you. What I can tell is that this is the proper way to make a game but maybe it's not the best point to start for a novice like you that is in urgent need.
http://www.richardlord.net/blog/actionscript-3-tetris-source-code
I would approach it like this in 2 parts.
Loop through your array of board positions starting from the bottom row and check for an empty unoccupied slot, if you find one do another loop through the row above till you find a piece on the same column. If you find a piece on the row above apply a tween to move it down to the empty slot and continue your loop.
Once you have looped through all rows, and animated all the tweens you need to loop through again to find all the gaps that need gems dropped into them. Create new elements at those positions and then move them up by (element height * row), apply another tween to animate them back to their starting position.

How to adjust the width of a font using the Uniscribe API

Please bear with me, I am new to Uniscribe so I hope this isn't a dumb question but I have been unable to find the solution anywhere else. So, here goes...
I am trying to use the Uniscribe API to reduce the width of a font; that is, given a specific font of a particular height, I would like to be able to reduce the width of each character (and all the relevant spacings) by some user-defined percentage.
I have successfully achieved this without calling any Uniscribe functions by obtaining a LOGFONT structure for the current font and adjusting the lfWidth field to be a percentage of its original value. I realise that this is just an average character width but it seemed to have the desired result.
However, when I try to do the same thing using Uniscribe I've noticed that the lfWidth field gets reset to 0 following calls to ScriptShape(). As a result, all rendered text is output using its original width. I'm at a loss to explain why this is or what to do to get around it.
Does anybody have any idea if it's even possible to do what I am trying to do?
You might want to start here (look at the Generate Glyph Information Section), then lead to this.
Hope it helps!

Resources