To be clear, the crosshair plugin has a 'x' only mode. But I assume you're posting this because you want an 'xy' crosshair that snaps only along the x axis.
You
could modify the plugin code you pasted but you don't need to.
Look at the example code in jquery.flot.crosshair.js:
The values passed in to lockCrosshair are the x,y coordinates of the point. You could pass in the y coordinate of the cursor instead.
plot.lockCrosshair({
x: item.datapoint[0],
y: pos.y
});
As you move the cursor, the crosshair moves with the cursor along the y axis, but is locked to the x position of the data point.
Here's an example:
http://jsfiddle.net/xeyo04uz/